将 Yii 项目移动到 cPanel 时出现 500 Internal Server Error
500 Internal Server Error when moving Yii project to cPanel
我在 cPanel 文件管理器中将 Yii 项目文件夹移动到 public_html 时遇到了一些问题。在本地主机 http://localhost:8888/eKehadiran/index.php
中它工作正常,但是当我将项目移动到 public_html 和 运行 ekehadiran.com/index.php
时,出现了错误。
这是 public_html 上的一些相关文件:
.htaccess
AddHandler application/x-httpd-php54 .php .php5 .php4 .php3
index.php
<?php
// 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();
您在 error_logs 文件中遇到了什么错误?请检查并尝试禁用该 .htaccess 行。
尝试在 index.php
中添加以下行
<?php
error_reporting(-1);
ini_set('display_errors', true);
// 必要时更改以下路径
它应该会显示错误
我在 cPanel 文件管理器中将 Yii 项目文件夹移动到 public_html 时遇到了一些问题。在本地主机 http://localhost:8888/eKehadiran/index.php
中它工作正常,但是当我将项目移动到 public_html 和 运行 ekehadiran.com/index.php
时,出现了错误。
这是 public_html 上的一些相关文件:
.htaccess
AddHandler application/x-httpd-php54 .php .php5 .php4 .php3
index.php
<?php
// 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();
您在 error_logs 文件中遇到了什么错误?请检查并尝试禁用该 .htaccess 行。
尝试在 index.php
中添加以下行<?php
error_reporting(-1);
ini_set('display_errors', true);
// 必要时更改以下路径
它应该会显示错误