Ketan Patel    29-Jul-2013

In this post, we will learn how to install & configure the CakePHP on localhost Wamp. I am using  Wamp Server as the webserver but, it will remain the same in XAMPP & many other Apache Based web servers as well because all those are build based on apache core. So, the configurations are mostly the same as Wamp Server.

So what you need to do is just follow the steps given below in order to install CakePHP on the localhost.

Step 1: Go to the CakePHP Official Website and download the latest version of CakePHP and unzip the file.

Step 2: Copy the downloaded folder in wamp www folder : C\wamp\www\(cake-folder)

Step 3: Now Go to (cake-folder)->app->Config->database.php.default and rename it as database.php. Now you need to make the required changes in it. After the changes, the configuration setting looks like below:

class DATABASE_CONFIG {

    public $default = array(
        'datasource' => 'Database/Mysql',
        'persistent' => false,
        'host' => 'localhost',
        'login' => 'root',
        'password' => '123456',
        'database' => 'cakephp_project',
        'prefix' => '',
        //'encoding' => 'utf8',
    );


    public $test = array(
        'datasource' => 'Database/Mysql',
        'persistent' => false,
        'host' => 'localhost',
        'login' => 'root',
        'password' => '',
        'database' => 'cake_test',
        'prefix' => '',
        //'encoding' => 'utf8',

    );

}

 

Step 4:  Open (cake-folder)->app->Config->core.php and change the values of the Security.salt and Security.cipherSeed. Default they were like:

Configure::write('Security.salt', 'DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi');
Configure::write('Security.cipherSeed', '76859309657453542496749683645');

You can change the code as per your preference. In this case, I am changing the code as bellow & save.

Configure::write('Security.salt', 'gk5454545fsdfUEsdfsbDsdh');
Configure::write('Security.cipherSeed', '54548785454521');

 

Step 5:  Make sure the (cake-folder)->tmp is writable and apache mod_rewrite is enabled.

Step 6: Open the browser and type: http://localhost/(cake-folder)/ and that's up. You're Done..!

install cakephp

If you received the above page that means you have installed & configured the CakePHP framework perfectly. The development of the CakePHP Framework can start now. Good luck with CakePHP. You can start with the basic tutorials like:

  • CakePHP CRUD
  • How to Upload Multiple Images in CakePHP
  • Dynamic Fields Validations

But…
In case if you don’t get the result as above that means you are having an issue with mod_rewrite. You will face the error of  "URL rewriting is not properly configured on your server." 

install cakephp error

To overcome this issue, follow the steps given here URL Rewriting is not Properly Configured on Your Server.


 

About Ketan Patel

A Web Developer having 7+ years of experience in web development. Worked with Laravel-Lumen, CakePHP, CodeIgniter, Opencart to make sites for startup companies and small businesses. Apart from blogging, he likes to read Novels, Listening music and Net surfing.