How to install CakePHP on localhost Wamp





In this post we will learn how to install & configure the CakePHP on localhost Wamp. I am using  Wamp Server as the web server but, it will remain 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 same as Wamp Server.

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

Step 1 : Go to CakePHP Official Website and Download updated Cake PHP and unzip the file.

Step 2 : Copy the downloaded folder in wamp folder : C->www->wamp->(cakefolder)

Step 3 : Now Go to (cakefolder)->app->Config->database.php.defult and rename it as database.php.Now you need to make required changes in it.After the changes, the configuration setting look like bellow.


class DATABASE_CONFIG {

    public $default = array(
        'datasource' => 'Database/Mysql',
        'persistent' => false,
        'host' => 'localhost',
        'login' => 'root',
        'password' => '',
        '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 (cakefoler)->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 am changing the code as bellow & save.


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


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

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

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



If you received above page that means you have install & configure the CakePHP framework perfectly. Development on CakePHP Framework can be start now.Good luck with CakePHP.

BUT…

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




To overcome this issue, follow the steps given in the Next Post.  

Comments

Popular posts from this blog

How to construct a B+ tree with example

How to show only month and year fields in android Date-picker?

Visitor Counter Script Using PHP