Codeigniter:远程系统和应用程序文件夹在主机上的安装问题


Codeigniter: Installation problems with remote system and app folders on byethost

在这里的codeigniter安装指南中,它说为了最好的安全性,系统和应用程序文件夹应该设置在web根目录之上。我有点喜欢这个主意,所以我试了一下。

在byehost示例中,它与htdocs(我认为)在同一个文件夹中

我通过echo $_SERVER['DOCUMENT_ROOT']获得服务器路径;我的是这样的:/home/vol8/byethost17.com/my_username/htdocs

所以我试着把路径放到index。php中作为

 $application_folder = 'home/vol8/byethost17.com/my_username/application';
 $system_path = 'home/vol8/byethost17.com/my_username/system';

但是没有成功

  Your system folder path does not appear to be set correctly. 
  Please open the following file and correct this: index.php

应用程序文件夹也一样吗?

有人能帮我把这个设置好吗?编辑:

细节:

主机php版本:5.3.14Codeiniter: 2.1.3在根目录中写入前提:rwxr-x——x

编辑2:

设置

   $application_folder = 'home/vol8/byethost17.com/my_username/htdocs/application';
   $system_path = 'home/vol8/byethost17.com/my_username/htdocs/system';

它将工作,这意味着可能是主机不允许这样做。

编辑3:

当我把

    $system_path = dirname(__FILE__) . "/../system";

页面不会加载,甚至不会显示错误信息

设置位于webroot上方目录中的CodeIgniter系统和应用程序文件夹的路径可以通过以下命令实现:

  1. systemapplication文件夹移到web浏览器上方。

  2. 打开index.php并更改:

    $system_folder = "system";
    

    // if you are using pre-php5.3
    $system_folder = dirname(__FILE__) . "/../system";
    // if you are using php5.3
    $system_folder = __DIR__ . "/../system";
    
  3. 取决于CodeIgniter的版本。

    3.1 For pre 2.0:

    $application_folder = "application";
    
    3.2 For 2.0+
    $application_folder = '../application';
    
相关文章: