If you have ssh shell access to you web server installing CakePHP very simple using git.
First, determine if you have git installed. At the command line type

git --help

If you get a response like “No command ‘git’ found” then you will need to first install git

#debian based systems
sudo apt-get install git

#rpm based systems
sudo yum install git

Clone the CakePHP repository and checkout the latest version

mkdir myapp
sudo git clone https://github.com/cakephp/cakephp.git myapp
cd myapp
sudo git checkout 2.1

The latest version of CakePHP is 2.1. As new versions are released you will probably want to use the latest. To get a list of available branches/tags use the the following git commands.

sudo git tag
// or
sudo git branch -a

If you see a branch/tag the is newer, switch to it using the checkout command

Updating to newer versions of CakePHP 2.1 as they are released.

We will first perform a git pull to refresh our copy of the CakePHP repo.

cd myapp
sudo git pull

Next, list the available branches/tags to find the latest version.

sudo git tag
// or
sudo git branch -a

Switch the the newer version

sudo git checkout 2.1

Display your current version of CakePHP

cat myapp/lib/Cake/VERSION.txt

or

sudo git describe --always --tag

Switching from CakePHP 2.0 to 2.1

If you have already cloned the CakePHP repo and are using version 2.0 there are some special considerations when switching to 2.1.

app/Controller/AppController.php must exist
app/Controller/PagesController.php must exist
app/Model/AppModel.php must exist
app/View/Helpers/AppHelper.php must exist
.htaccess has changed

For more information on Migrating from CakePHP 2.0 to 2.1 see the 2.1 Migration Guide

Keywords:

  • git cakephp