2013-09-30 43 views
1

我有一个使用CakePHP旧版本构建的脚本。该脚本在实时服务器上工作得很好,但是当我试图在我的电脑上安装它时(安装了XAMPP)igot问题。 ..我有这样的错误:在本地pc(xampp)上安装CakePHP不正确的路径

Warning: include(cake\bootstrap.php): failed to open stream: No such file or directory in C:\xampp\htdocs\hack\index.php on line 76

Warning: include(): Failed opening 'cake\bootstrap.php' for inclusion (include_path='\C:\xampp\htdocs\hack\cakecore;\C:\xampp\htdocs\hack\cakeapp\;.;C:\xampp\php\PEAR') in C:\xampp\htdocs\hack\index.php on line 76

Fatal error: CakePHP core could not be found. Check the value of CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php. It should point to the directory containing your \cake core directory and your \vendors root directory. in C:\xampp\htdocs\hack\index.php on line 77

我敢肯定,这个错误是由index.php文件不正确的路径引发的,因为如果我在索引中的直播网站上做出错误的道路得到了完全相同的erorr问题是我不知道如何修复这些路径。

我的网站文件位于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天的时间,并找不到解决方案。

+0

你的文件夹叫做'cakeapp'?而cakephp核心是'cakecore'? –

+0

是的,正确的。该脚本在活服务器上工作得很好,但在我的电脑上触发错误.. –

+0

对,但:错误很明显:无法找到文件夹/文件。但是,这个文件夹真的存在吗? –

回答

1

您正在将CAKE_CORE_INCLUDE_PATH定义为DS.'C:'.DS.'xampp'.DS.'htdocs'.DS.'mysite'.DS.'cakecore',它将在Windows中转换为错误路径\C:\xampp\htdocs\mysite\cakecore。注意,它应该是C:\...,并以\开头。

因此,使它'C:'.DS.'xampp'.DS.'htdocs'.DS.'mysite'.DS.'cakecore''C:\xampp\htdocs\mysite\cakecore',因为没有使用DS如果你把C:路径中的任何advantagle,它将在窗口只工作毕竟。

+0

感谢user221931,这是问题,因为我不是一个编码器,并不知道是什么让erorr.thanks非常多的帮助你...... –

+0

很高兴我帮了忙。你应该记住上传有用的答案,并将最适合你的解决方案标记为已接受。 – user221931