0

I'm trying to open my first yii application just when I write localhost it gives this error :

Warning: require_once(C:\inetpub\wwwroot/../yii-1.1.21.733ac5/yii-1.1.21.733ac5/framework/yii.php): failed to open stream: No such file or directory in C:\inetpub\wwwroot\index.php on line 13

Fatal error: require_once(): Failed opening required 'C:\inetpub\wwwroot/../yii-1.1.21.733ac5/yii-1.1.21.733ac5/framework/yii.php' (include_path='.;C:\php\pear') in C:\inetpub\wwwroot\index.php on line 13

which and where the file for the yii.app I must put it ?

Here's what in the index :

<?php // change the following paths if necessary $yii=dirname(__FILE__).'C:\yii\yii-1.1.21.733ac5\yii-1.1.21.733ac5\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(); ?> 

1 Answer 1

2

The issue is with the path given to load the Yii framework:

// change the following paths if necessary $yii=dirname(__FILE__).'C:\yii\yii-1.1.21.733ac5\yii-1.1.21.733ac5\framework\yii.php'; 

The dirname(__FILE__) is the dirname (parent directory path) of your index.php, so you shouldn't append an absolute path to it, but a relative one, e.g.:

$yii=dirname(__FILE__).'/../yii/framework/yii.php'; 

Or just use an absolute path:

$yii='C:\yii\yii-1.1.21.733ac5\yii-1.1.21.733ac5\framework\yii.php'; 

Are you sure the folder yii-1.1.21.733ac5 should be in the path twice?

Finally, please note that Yii 1 has reached its lifetime and only receives security fixes. You should definitely use Yii 2 for new projects.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.