如何在Ubuntu中更改Cake Console?

时间:2014-04-08 10:09:21

标签: php cakephp console

我已下载Cake PHP v2.7.0。现在,我需要更改烘焙的控制台路径。我应该使用什么命令将控制台从当前v1.3.0更改为v2.7.0。我尝试使用以下命令

app/Console/cake bake

/var/www/project_name/app/Console/cake.php bake

但是,我仍然没有使用控制台进行更新。我正在使用ubuntu OS。我应该尝试在系统中更改蛋糕控制台的命令是什么?当我进入Console文件夹并执行命令“cake”时,我收到以下警告:

PHP Warning:  /usr/share/php/cake/console/templates/skel/tmp/cache/ is not writable in /usr/share/php/cake/libs/cache/file.php on line 281
PHP Stack trace:
PHP   1. {main}() /usr/share/php/cake/console/cake.php:0
PHP   2. ShellDispatcher->ShellDispatcher() /usr/share/php/cake/console/cake.php:664
PHP   3. ShellDispatcher->_initEnvironment() /usr/share/php/cake/console/cake.php:136
PHP   4. ShellDispatcher->__bootstrap() /usr/share/php/cake/console/cake.php:176
PHP   5. include_once() /usr/share/php/cake/console/cake.php:272
PHP   6. Cache->config() /usr/share/php/cake/console/templates/skel/config/core.php:304
PHP   7. Cache->_buildEngine() /usr/share/php/cake/libs/cache.php:141
PHP   8. FileEngine->init() /usr/share/php/cake/libs/cache.php:166
PHP   9. FileEngine->__active() /usr/share/php/cake/libs/cache/file.php:94
PHP  10. trigger_error() /usr/share/php/cake/libs/cache/file.php:281

Warning: /usr/share/php/cake/console/templates/skel/tmp/cache/ is not writable in /usr/share/php/cake/libs/cache/file.php on line 281

Call Stack:
    0.0016     380824   1. {main}() /usr/share/php/cake/console/cake.php:0
    0.0174     381144   2. ShellDispatcher->ShellDispatcher() /usr/share/php/cake/console/cake.php:664
    0.1012     535216   3. ShellDispatcher->_initEnvironment() /usr/share/php/cake/console/cake.php:136
    0.1013     538040   4. ShellDispatcher->__bootstrap() /usr/share/php/cake/console/cake.php:176
    0.2275    1716776   5. include_once('/usr/share/php/cake/console/templates/skel/config/core.php') /usr/share/php/cake/console/cake.php:272
    0.2300    1898096   6. Cache->config() /usr/share/php/cake/console/templates/skel/config/core.php:304
    0.2300    1899448   7. Cache->_buildEngine() /usr/share/php/cake/libs/cache.php:141
    0.2340    1956656   8. FileEngine->init() /usr/share/php/cake/libs/cache.php:166
    0.2347    1959744   9. FileEngine->__active() /usr/share/php/cake/libs/cache/file.php:94
    0.2647    2568904  10. trigger_error() /usr/share/php/cake/libs/cache/file.php:281



Welcome to CakePHP v1.3.14 Console
---------------------------------------------------------------
Current Paths:
 -app: Console
 -working: /var/www/cakelatest/app/Console
 -root: /var/www/cakelatest/app
 -core: /usr/share/php

Changing Paths:
your working path should be the same as your application path
to change your path use the '-app' param.
Example: -app relative/path/to/myapp or -app /absolute/path/to/myapp

Available Shells:
 acl [CORE]                             i18n [CORE]                            
 api [CORE]                             schema [CORE]                          
 bake [CORE]                            testsuite [CORE]                       
 console [CORE]                         

To run a command, type 'cake shell_name [args]'
To get help on a specific command, type 'cake shell_name help'

我在这里错过了什么?

2 个答案:

答案 0 :(得分:0)

  

PHP警告:/ usr / share / php / cake / console / templates / skel / tmp / cache /在第281行的/usr/share/php/cake/libs/cache/file.php中无法写入

对我来说听起来像是一个许可问题。

你可以在这里打印

的输出
ls -la /usr/share/php/cake/console/templates/skel/tmp/cache | grep -e " \.$"

答案 1 :(得分:0)

在网络上打开应用程序时,cakephp更改/APP/tmp/文件夹,您需要与www-data用户一起运行cake命令,您可以使用以下命令:

 sudo www-data php Console/cake.php bake