2016-02-22 111 views
1

所以我有一个问题,打开一个在Yii框架中工作的项目。我安装了XAMPP,下载了Yii所需的文档,提取了需要的所有东西,就像说的那样,但是仍然在写这条消息:连接到Yii框架

“Warning:require_once(C:\ xampp \ htdocs \ radnici \ framework \ yii.php) :无法打开流:没有这样的文件或目录在C:\ xampp \ htdocs \ radnici \ index.php在线12

致命错误:require_once():失败打开需要'C:\ xampp \ htdocs \ radnici在第12行的C:\ xampp \ htdocs \ radnici \ index.php中创建了一个\ framework \ yii.php'(include_path ='.; C:\ xampp \ php \ PEAR')\

\

Heres the index.php code :

// change the following paths if necessary 
$yii=dirname(__FILE__).'\framework\yii.php'; 
$config=dirname(__FILE__).'/protected/config/main.php'; 

// remove the following lines when in production mode 
defined('YII_DEBUG') or define('YII_DEBUG',true); 
// specify how many levels of call stack should be shown in each log message 
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3); 

require_once($yii); 
Yii::createWebApplication($config)->run(); 
+0

那么,在'index.php'所在的同一目录中是否存在'framework'文件夹? – h2ooooooo

+0

是的,当然,我说我做了 –

+0

不,你说你“提取了所有需要的东西”,但是你的PHP安装却抱怨说C:\ xampp \ htdocs \ radnici \ framework \ yii.php不存在,因此我问它*是否存在。如果它存在,那么你需要确保该文件可以被XAMPP正在使用的用户读取,但很可能(因为它是Windows),一切都应该是默认可读的。 – h2ooooooo

回答

0

您是否尝试从作曲家安装? 这是安装yii的首选方式

+0

我会尝试然后我会通知你。 –

+0

或尝试运行'init()' –

+0

我已成功从composer安装它。谢谢 –