3 simple steps to install CakePHP in your xampp (Windows)

Most of the people struct to install cakephp in windows. So that today we are going learn installation steps about CakePHP.

Step1:

Download CakePHP package from http://cakephp.org/ and extract that package and locate it your xampp htdocs.

Example: I have an application and my application path is G:/xampp/htdocs/cakephp/sample. Here “sample” is my application root folder.

“sample” application  file structure:

 Step2:

You can access this application http://localhost/cakephp/sample/ but still it has URL rewriting issues.So that in this step we avoid that URL rewriting  problem by creating custom apache conf file.

I have created one custom apache configuration  file and locate it to my xampp/apache/conf  folder.

Example: custom.conf 

I have located it to G:/xampp/apache/conf/custom.conf then i have written apache alias rule for redirection with directory access.

Ref: http://httpd.apache.org/docs/2.2/mod/mod_alias.html#alias

Here i have added my custom.conf configuration

and then we need to do little modification in  G:/xampp/apache/conf/httpd.conf  file. Just include this custom.conf file in to your httpd.conf

Here is my code

And then you must add RewriteBase in application htaccess files. In my sample application i have followed like this type htaccess and also i have added that code

sample/.htaccess

sample/app/.htaccess

sample/app/webroot/.htaccess

that’s it. This is simplest way to avoid URL rewriting issue in CakePHP..

Step3:

Then. You must change the security salt in your core.php file

location : sample/app/Config/core.php

No need apache VirtualHost concept but we have used apache alias concept instead of this.

Now your CakePHP installation is ready. Put this url to your browser http://localhost/sample then you can your cakephp application

cakephp

 

  • http://CharlieMiles.net Charlie

    Database woes.

    I was super stoked when I saw your tutorial and then saddened when I saw that it cuts off right before the database connection step. Cake doesn’t want to connect to the database that I made in PHP myAdmin. Really hung up on this.


    public $default = array(
    'datasource' => 'Database/Mysql',
    'driver' => 'mysql',
    'persistent' => false,
    'host' => '127.0.0.1',
    'login' => 'admin',
    'password' => 'UNDISCLOSEDLOL',
    'database' => 'appdb',
    'prefix' => '',
    'encoding' => 'utf8'
    );

    Maybe other people are too!

    Charlie

  • khaoula

    Please i am a beginner with cakephp and i want to work with the version 1.2.11 someone can help me i would be thankful! :)

  • khaoula

    I have already tried those steps but doesn’t work :( ..It is an emergency for me…. Waiting for your help!!

  • atif

    Although it is good to practice code on local host first but You may need to install CakePHP on Cloud server http://goo.gl/0OvPKW as well by following the steps in the tutorial.