【发布时间】:2012-10-30 14:46:51
【问题描述】:
我将我的应用程序从一台服务器(开发)移动到另一台服务器(发布),并且蛋糕落在了 lib/Cake/bootstrap.php 文件中,这是蛋糕核心文件之一。
前一个地址(正在运行)是http://sdruzenid.kho.cz 地址http://sdruzenid.cz 是错误。
我只是将所有文件从一台服务器复制到另一台服务器。没有硬编码的地址
在第一个服务器上,adresar 结构是
根目录:/sdruzenid
应用程序:/sdruzenid/app
网络根目录:/sdruzenid/app/webroot
不使用 adresar www(因为其他网络在其中运行,这只是子域)
它在新位置
根目录:/www
应用程序:/www/app
网络根目录:/www/app/webroot
当我从 app/webroot/index.php 打印路径时,它是:
根目录:/httpd/html/sdruzenidcz/www
WWW_ROOT:/httpd/html/sdruzenidcz/www/app/webroot/
CAKE_CORE_INCLUDE_PATH: /httpd/html/sdruzenidcz/www/lib:/httpd/html/sdruzenidcz:./
lib/Cake/bootstrap.php 中的这段代码会导致错误
App::uses('ErrorHandler', 'Error');
App::uses('Configure', 'Core');
App::uses('CakePlugin', 'Core');
App::uses('Cache', 'Cache');
App::uses('Object', 'Core');
App::$bootstrapping = true;
错误在最后一行。我找不到变量 $bootstrapping 是在哪里定义或设置的,但这是在蛋糕核心中,在开发部署时它工作正常
在我的代码 app/webroot.index.php 附近的错误是:
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
if (function_exists('ini_set')) {
ini_set('include_path', ROOT . DS . 'lib' . PATH_SEPARATOR . ini_get('include_path'));
}
//it crashes after include of bootstrap.php
if (!include 'Cake' . DS . 'bootstrap.php') {
$failed = true;
}
} else {
if (!include CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'bootstrap.php') {
$failed = true;
}
}
【问题讨论】: