CakePHP publishes a PEAR package that you can install using the PEAR installer.
Installing with the PEAR installer can simplify sharing CakePHP libraries
across multiple applications. To install CakePHP with PEAR you’ll need to do the
following:

pearchannel-discoverpear.cakephp.orgpearinstallcakephp/CakePHP

Note

On some systems installing libraries with PEAR will require sudo.

After installing CakePHP with PEAR, if PEAR is configured correctly you should
be able to use the cake command to create a new application. Since CakePHP
will be located on PHP’s include_path you won’t need to make any other
changes.

Before starting you should make sure that you have got an up to date PHP
version:

php -v

You should at least have got installed PHP 5.3.0 (CLI) or higher.
Your webserver’s PHP version must also be of 5.3.0 or higher, and should best be
the same version your command line interface (CLI) PHP version is of.

Composer is a dependency management tool for PHP 5.3+. It solves many of the
problems the PEAR installer has, and simplifies managing multiple versions of
libraries. Packagist is the main repository of
Composer installable packages. Since CakePHP also publishes releases to
Packagist, you can install CakePHP using Composer.

Save this JSON into composer.json in the APP directory of your project.
Next download the composer.phar file into your project. After you’ve downloaded
Composer, install CakePHP. In the same directory as your composer.json run
the following:

$phpcomposer.pharinstall

Once Composer has finished running you should have a directory structure that looks like:

There may be some situations where you wish to place CakePHP’s directories on
different places on the filesystem. This may be due to a shared host
restriction, or maybe you just want a few of your apps to share the same CakePHP
libraries. This section describes how to spread your CakePHP directories across
a filesystem.

First, realize that there are three main parts to a CakePHP application:

The core CakePHP libraries, in /lib/Cake.

Your application code, in /app.

The application’s webroot, usually in /app/webroot.

Each of these directories can be located anywhere on your file system, with the
exception of the webroot, which needs to be accessible by your web server. You
can even move the webroot folder out of the app folder as long as you tell
CakePHP where you’ve put it.

To configure your CakePHP installation, you’ll need to make some changes to the
following files.

It is recommended to use the DS constant rather than slashes to delimit file
paths. This prevents any missing file errors you might get as a result of using
the wrong delimiter, and it makes your code more portable.