Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>


Tags: cakephp


CakePHP is fast and easy to install. The minimum requirements are a webserver and a copy of Cakephp, that’s it! While this manual focuses primarily on setting up on Apache (because it’s the most commonly used), you can configure CakePHP to run on a variety of web servers such as lighttpd or Microsoft IIS.


  • HTTP Server. For example: Apache. mod_rewrite is preferred, but by no means required.
  • PHP 5.3.0 or greater (CakePHP version 2.6 and below support PHP 5.2.8 and above).
  • Technically a database engine isn’t required, but we imagine that most applications will utilize one. CakePHP supports a variety of database storage engines:
  • MySQL (4 or greater)
  • PostgreSQL
  • Microsoft SQL Server
  • SQLite


CakePHP is licensed under the MIT license. This means that you are free to modify, distribute and republish the source code on the condition that the copyright notices are left intact. You are also free to incorporate CakePHP into any commercial or closed source application.


There are two main ways to get a fresh copy of CakePHP. You can either download an archived copy (zip/tar.gz/tar.bz2) from the main website, or check out the code from the git repository. To download the latest major release of CakePHP, visit the main website and follow the “Download” link. All current releases of CakePHP are hosted on GitHub. GitHub houses both CakePHP itself as well as many other plugins for CakePHP. The CakePHP releases are available at GitHub tags. Alternatively you can get fresh off the press code, with all the bug-fixes and up to the minute enhancements. These can be accessed from GitHub by cloning the GitHub repository:

git clone git://


CakePHP uses the app/tmp directory for a number of different operations. A few examples would be Model descriptions, cached views and session information. As such, make sure the directory app/tmp and all its subdirectories in your CakePHP installation are writable by the web server user. One common issue is that the app/tmp directories and subdirectories must be writable both by the web server and the command line user. On a UNIX system, if your web server user is different from your command line user, you can run the following commands just once in your project to ensure that permissions will be setup properly:
HTTPDUSER=`ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1` setfacl -R -m u:${HTTPDUSER}:rwx app/tmp setfacl -R -d -m u:${HTTPDUSER}:rwx app/tmp


Setting up CakePHP can be as simple as slapping it in your web server’s document root, or as complex and flexible as you wish. This section will cover the three main installation types for CakePHP: development, production, and advanced.
  • Development: easy to get going, URLs for the application include the CakePHP installation directory name, and less secure.
  • Production: Requires the ability to configure the web server’s document root, clean URLs, very secure.
  • Advanced: With some configuration, allows you to place key CakePHP directories in different parts of the filesystem, possibly sharing a single CakePHP core library folder amongst many CakePHP applications.


A development installation is the fastest method to setup CakePHP. This example will help you install a CakePHP application and make it available at We assume for the purposes of this example that your document root is set to /var/www/html. Unpack the contents of the CakePHP archive into /var/www/html. You now have a folder in your document root named after the release you’ve downloaded (e.g. cake_2.0.0). Rename this folder to cake_2_0. Your development setup will look like this on the file system:
/var/www/html/ cake_2_0/ app/ lib/ plugins/ vendors/ .htaccess index.php README
If your web server is configured correctly, you should now find your CakePHP application accessible at

This post first appeared on BEST TRAINING IN PHP.., please read the originial post: here

Share the post



Subscribe to Best Training In Php..

Get updates delivered right to your inbox!

Thank you for your subscription