yii - 上传到Web主机后的内部服务器错误(500)

时间:2014-07-01 03:36:55

标签: php .htaccess yii

昨天,我将我的yii项目网站上传到了servobox网站主办。

我的index.php

    <?php

// change the following paths if necessary
$yii=dirname(__FILE__).'/../hshome/paperchoicecomph/p/yii/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();

当在localhost中它工作正常,但当我上传它时,它给我这个错误“500 - 内部服务器错误。您正在寻找的资源存在问题,并且无法显示。”

有人可以帮我修复此错误。我搜索论坛并尝试一些解决方案,但没有任何作用。

请帮助:(

1 个答案:

答案 0 :(得分:0)

您需要检查apache错误日志以获取确切错误,在CentOS中,您可以通过SSH登录服务器实时显示错误日志并执行以下命令

tail -f /usr/local/apache/logs/error_log

它可能是与文件权限相关的错误,默认情况下,后端和前端的索引文件对组具有错误的写入权限

[Tue Oct 25 08:01:58.895038 2016] [:error] [pid ...] [client ...]
SoftException in Application.cpp:256: File ".../backend/web/index.php" 
is writeable by group

您只需要将权限从664更改为644,您就可以了。

确保在前端和后端索引文件中执行此操作。

相关问题