在共享服务器上设置Yii1.13错误

时间:2013-09-24 16:24:25

标签: php yii

    我想上传一个共享服务器的网站。

结构

        
  • 的public_html         
                  
    • Yii的(文件夹)
    •             
    • index.php(在根文件夹内)
    •         
        

我只是收到这条消息“服务器错误”。请问有人可以告诉我问题出在哪里或者我应该在代码中做些什么来使其工作。我的索引代码是:

<?php

// yii directory paths<br/>
$yii=dirname(__FILE__).'/yii/yii.php';

$config=dirname(__FILE__).'/protected/config/main.php';

// remove the following lines when in production mode<br/>

defined('YII_DEBUG') or define('YII_DEBUG',true);

// specify how many levels of call stack should be shown in each log message<br/>
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
require_once($yii);
Yii::createWebApplication($config)->run();

?>

<?php // yii directory paths<br/> $yii=dirname(__FILE__).'/yii/yii.php'; $config=dirname(__FILE__).'/protected/config/main.php'; // remove the following lines when in production mode<br/> defined('YII_DEBUG') or define('YII_DEBUG',true); // specify how many levels of call stack should be shown in each log message<br/> defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3); require_once($yii); Yii::createWebApplication($config)->run(); ?>

1 个答案:

答案 0 :(得分:0)

如果您可以成功安装welcome yii应用程序,那么您的应用程序本身就会出现index.php文件的问题。一种简单的方法是复制演示应用程序生成的index.php文件,并将其复制粘贴到原始应用程序中。确保将应用程序保存在您保存演示应用程序的相同位置。 此外,如果您也使用过composer,请确保您的供应商目录在那里。然后检查权限是否正确给予文件夹。特别是运行时和assets文件夹。如果有疑问,你可以简单地chmod 777。 如果仍然出现错误,那么您在应用中使用的内容肯定存在问题,可能会遗漏某些内容。 请务必正确表达错误信息,以便我们更好地了解您所面临的问题。

相关问题