我有使用旧版本的 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 天时间,但找不到解决方案。