2016-02-22 109 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安裝它。謝謝 –