【发布时间】:2013-10-06 08:34:45
【问题描述】:
我有一个使用旧版本 CakePHP 构建的脚本。该脚本在实时服务器上运行良好,但是当我尝试在我的电脑上安装它(安装了 XAMPP)时出现问题...我有这个错误:
警告:include(cake\bootstrap.php):无法打开流:第 76 行的 C:\xampp\htdocs\hack\index.php 中没有这样的文件或目录
警告:include():无法打开“cake\bootstrap.php”以包含(include_path='\C:\xampp\htdocs\hack\cakecore;\C:\xampp\htdocs\hack\cakeapp\;. ;C:\xampp\php\PEAR') 在 C:\xampp\htdocs\hack\index.php 第 76 行
致命错误:找不到 CakePHP 核心。检查 APP/webroot/index.php 中 CAKE_CORE_INCLUDE_PATH 的值。它应该指向包含你的 \cake 核心目录和你的 \vendors 根目录的目录。在第 77 行的 C:\xampp\htdocs\hack\index.php 中
我很确定这个错误是由 index.php 文件中不正确的路径触发的,因为如果我在实时网站上的索引中输入了错误的路径会得到完全相同的错误。问题是我不知道如何修复路径。
我的站点文件位于:C:\xampp\htdocs\mysite
这就是我在 index.php 文件中创建路径的方法:
/**
* The full path to the directory which holds "app", WITHOUT a trailing DS.
*
*/
if (!defined('ROOT')) {
define('ROOT', DS.'C:'.DS.'xampp'.DS.'htdocs'.DS.'mysite');
}
/**
* The actual directory name for the "app".
*
*/
if (!defined('APP_DIR')) {
define('APP_DIR', 'cakeapp');
}
/**
* The absolute path to the "cake" directory, WITHOUT a trailing DS.
*
*/
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
define('CAKE_CORE_INCLUDE_PATH', DS.'C:'.DS.'xampp'.DS.'htdocs'.DS.'mysite'.DS.'cakecore');
}
你能告诉我我错过了什么吗?我花了 2 天的时间来解决这个问题。
【问题讨论】:
-
您的文件夹名为
cakeapp? cakephp 的核心是cakecore? -
是的,正确的。该脚本在实时服务器上运行良好,但在我的电脑触发错误..
-
正确,但是:错误很明显:找不到文件夹/文件。但是,这个文件夹真的存在吗?