Archive for the ‘ Linux ’ Category

Installing CakePHP on Ubuntu

CakePHP is a rapid development framework for PHP that provides an extensible architecture for developing, maintaining, and deploying applications. Using commonly known design patterns like MVC and ORM within the convention over configuration paradigm, CakePHP reduces development costs and helps developers write less code.

Installation is actually quite an easy task. But I couldn’t find good information at the beginning. So here I am writing for you. I am using Ubuntu 9.10. This will work for any *nix systems.

Step 1:

In order to work with cakephp you need to have Apache server , MySql Database and PHP. To get them

sudo apt-get install apache2 mysql-server php5

Step 2:

Download the Latest version or the stable version of Cakephp. You can get it from here download
I am using 1.2 version of cakephp

Step 3:

Copy and Extract the compressed file to the webroot(/var/www) and rename to cakephp or some project_name. Open http://localhost/cakephp in your browser. You will see something like this.

cakephp installation step3cakephp installation step3

Step 4:

Enable write permission for app/temp
sudo chmod -R 777 cakephp/app/tmp

Step 5:

Enable mod_rewrite. More about mod_rewrite here.

sudo a2enmod rewrite

Step 6:

Edit the file /etc/apache2/sites-enabled/000-default and change AllowOverride None to AllowOverride All. You can use any text editor. I am using vi editor.

sudo vi /etc/apache2/sites-enabled/000-default

<Directory /var/www>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all

Step 7:

Changing the value of security.salt in app/config/core.php. At line 151 or near to it you can see something like this
Configure::write(‘Security.salt’, ‘DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi’);

Just change the value of it.I have come up with this value
Configure::write(‘Security.salt’, ‘UubWwvniR2G0FgaC9miDYhG93b0qyJfIxfs2guVo’);

Step 8:

Database Configuration. The database configuration file is located at cakephp/app/config/database.php.default
change the file name to database.php
sudo mv database.php.default database.php

Then edit the following

sudo vi cakephp/app/config/database.php


var $default = array(
'driver' => 'mysql',
'persistent' => false,
'host' => 'localhost',
'login' => 'root',
'password' => 'sudeep',
'database' => 'cakephp',
'prefix' => '',

You can connect to any database you want. Make sure that username and password of your database are correct.

Step 9:

Restart Apache server to see changes
sudo /etc/init.d/apache2 restart

Step 10:

Open http://localhost/cakephp/ in your browser.If all goes well you should be able to cakephp page in colors, something like this.

cakephp installation step10cakephp installation step10


WordPress, HTML, CSS, PHP, Javascript And More Cheat Sheets

Cheat sheets are really helpful in revising the codes as there are so many codes which we cannot remember always but cheat sheets are of great help in keeping yourself updatedwith the codes.

Cheat sheets are also helpful for beginner developers and designers in learning and remembering codes better. A truly great resource for upcoming developers.

The purpose of this post is to provide all the cheat sheets useful for designers and developers at one place. A mega collection of cheat sheets which contains HTML, CSS, JAVA, PHP, Database SQL, WordPress, Aspx, SEO and many more other useful cheat sheets which you will find in this post. Most of the cheat sheets are available in printable format for a handy use of these resources.













Browser Shortcut Cheats

Bookmark and Share

Install XAMPP in ubuntu

Install XAMPP:


Download the most recent version of XAMPP: (at time of writing 1.5.3a)…ar.gz?download

(Source URL:


Extract the archive to /opt using sudo: (make sure you are in the directory that you downloaded the archive to)

Terminal Code:

Xampp install


To start it up, open a terminal and type this:

start xampp


To stop it, open a terminal and type this:

stop xampp

Sweet XAMPP Control Panel:

Run in a terminal:

gedit ~/.local/share/applications/xampp-control-panel.desktop

[Desktop Entry]
Comment=Start/Stop XAMPP
Name=XAMPP Control Panel
Exec=gksudo "python /opt/lampp/share/xampp-control-panel/"
Name[en_CA]=XAMPP Control Panel
Comment[en_CA]=Start/Stop XAMPP

Enter this above code in gedit window


Click -> Application -> others -> xampp Control Panel

XAMPP Control Panel

Test to see if XAMPP is running:

Once XAMPP is up and running open firefox and go to: http://localhost/

Location of files and uploading

XAMPP by default uses /opt/lampp/htdocs as the root web directory. The easiest way to start working on files is to link a folder in your home directory into this directory.
My user name is netaji so I have /home/netaji/public_html linked to /opt/lampp/htdocs/netaji. So if I navigate to http://localhost/netaji/ I get a listing of all the files/folders in that directory. (As long is there isn’t a index.php/html/etc file)
To set this up, run in a terminal:

  1. Make public_html directory in home directory:
    mkdir ~/netaji
  2. Link to /opt/lampp/htdocs
    sudo ln -s ~/netaji /opt/lampp/htdocs/$USER

Now any files and folders you place in ~/public_html will be published to your personal webserver.

Bookmark http://localhost/username to make this easy to access.