As the others already pointed out, CakePHP from the repositories is v1.3.2 which doesn't work with your 2.1.
After uninstalling (sudo apt-get remove cakephp-scripts
) it, do the following:
- Download CakePHP 2.1 and extract it somewhere globally available (e.g.
/usr/share/php/cakephp/
- Check the permissions:
/usr/share/cakephp/
and all subfolders should be readable for everyone and /usr/share/cakephp/app/Console/cake
should be executable.
Now link your executable from /usr/bin/
:
cd /usr/bin
ln -s /usr/share/php/cakephp/app/Console/cake cake
You should now be able to use the right version of the script everywhere from the console.
If you want to make the version of cake switchable comfortably, you should put the sources in a subfolder, i.e. /usr/share/php/cakephp/2.1/
and link there: ln -s 2.1 current
. Now you can link from /usr/bin
to your current
directory: ln -s /usr/share/php/cakephp/current/app/Console/cake cake
. If you ever want to switch versions, the only thing you have to do is to change, where current
links to.