哪个[how?]是定义了lib / Cake / Error / ErrorHandler.php的路径?

时间:2016-08-22 08:37:44

标签: cakephp ubuntu-14.04 cakephp-2.5

正在下载项目。来自在线服务器&试图在我的localhost中运行它,但我遇到了路径问题。我没有看到路径的定义,但是,我收到了错误:

[Mon Aug 22 14:12:10.681539 2016] [:error] [pid 1186] [client 127.0.0.1:47932] PHP Warning:  include(/home3/username/public_html/lib/Cake/Error/ErrorHandler.php): failed to open stream: No such file or directory in /var/www/proj/lib/Cake/Core/App.php on line 547

在线服务器的路径位于/home3/username,但我的localhost中有/var/www

我没有看到本地提到home3username的位置(按ctrl + shift + f)。

我正在使用Cakephp v2.5.3

------更新-----

除了路径,我看到Cakephp 2将不能与php7一起使用,因此安装php5设法使项目正常工作。 https://askubuntu.com/questions/756879/cant-install-php5-on-ubuntu-16-04

2 个答案:

答案 0 :(得分:0)

转到app / webroot并打开index.php文件,找到定义函数CAKE_CORE_INCLUDE_PATH,并将值更改为路径。

/**
 * The absolute path to the "cake" directory, WITHOUT a trailing DS.
 *
 * Un-comment this line to specify a fixed path to CakePHP.
 * This should point at the directory containing `Cake`.
 *
 * For ease of development CakePHP uses PHP's include_path. If you
 * cannot modify your include_path set this value.
 *
 * Leaving this constant undefined will result in it being defined in Cake/bootstrap.php
 *
 * The following line differs from its sibling
 * /app/webroot/index.php
 */
define('CAKE_CORE_INCLUDE_PATH', 'C:' . DS . 'xampp' . DS . 'htdocs' . DS . 'cakephp' . DS . 'lib');

答案 1 :(得分:0)

如果您已经从在线服务器上下载了项目并在本地主机上运行它,请清除app / tmp /中的文件。之后,它将正常工作。