【问题标题】:yii framework no such file in directoryyii 框架目录中没有这样的文件
【发布时间】:2014-10-30 15:24:37
【问题描述】:

最近,我尝试安装一个需要 yii 框架的应用程序。 不幸的是,它似乎在我的框架目录中找不到 yii.php 文件,因此给了我一个内部服务器错误。

我已经搜索了很长时间的答案,但没有任何结果。我很确定目录和文件都在那里。

错误:

PHP Warning:  require_once(/home/site/public_html/framework/yii.php): failed to open stream: No such file or directory in /home/site/public_html/index.php on line 15
PHP Fatal error:  require_once(): Failed opening required '/home/site/public_html/framework/yii.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/site/public_html/index.php on line 15

index.php:

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

if(!is_readable($config))
    exit('Missing configuration file. Please run the <a href="./install">installation</a>.');

// 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();

我还对目录 (777) 进行了 CHMODDED,但没有任何结果。 感谢您的帮助。

【问题讨论】:

  • 你确定文件/home/site/public_html/framework/yii.php存在吗?
  • 你能展示你的目录结构吗?
  • @excluded_once prntscr.com/51odme
  • 首页后的站点目录是什么?在屏幕截图中我看不到任何站点目录...您是否尝试 var_damp $yii 来查看那里的通行证?

标签: php yii


【解决方案1】:

您问题中的路径是 /home/site/public_html/framework/yii.php 但是在图片中,我看到了:/home/mbbclanv/……这是错误的。

【讨论】:

    【解决方案2】:

    如果你确定文件存在并且路径正确,试试这个

    chmod -R 777 /home/site/public_html/
    

    -R 递归提供权限。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-12-14
      • 1970-01-01
      • 1970-01-01
      • 2021-03-06
      • 2021-06-24
      • 1970-01-01
      • 2015-02-20
      • 1970-01-01
      相关资源
      最近更新 更多