right way to install cakephp-scripts for v2.2.1?

三世轮回 提交于 2019-12-05 13:33:09

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:

  1. Download CakePHP 2.1 and extract it somewhere globally available (e.g. /usr/share/php/cakephp/
  2. Check the permissions: /usr/share/cakephp/ and all subfolders should be readable for everyone and /usr/share/cakephp/app/Console/cake should be executable.
  3. Now link your executable from /usr/bin/:

    cd /usr/bin
    ln -s /usr/share/php/cakephp/app/Console/cake cake
    
  4. 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.

Check your PATH variable in Linux, it might be pointing to an old version of cake

Instead of running cake bake directly run it fromcakeDir/app by doing Console/cake bake. The thing is that install cakephp-scripts installs and old version of the cake scripts.

Sarwar Sikder

Go to your terminal

1. sudo apt-get remove cakephp-scripts 
2.cd /var/www/html/yourproject/app/Console/
3.sh cake bake

I think you will be able to use cake bake console with your cakePHP same version.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!