调用公用文件夹外的数据库和文件 - CodeIgniter

时间:2016-04-21 19:28:14

标签: php codeigniter variables request-uri

第一篇文章! ......我需要一些帮助:D

我们使用Code-Igniter作为我们网站的基础框架(定制)。它的编程方式,我们可以从网站上调用存储在公共文件夹外的一些文件和数据库(出于安全考虑),我们几天前就进行了域/服务器转换,目前该网站已被破坏因为它不允许我们进行这些调用(system_path)。

经过一些研究,我发现可能的原因是我的服务器不支持REQUEST_URI变量。所以,我做了一个工作,但没有很好的结果。

主网络正常, 我从所有其他溃疡中得到的错误是这个:

  

内部服务器错误

     

服务器遇到内部错误或配置错误   无法完成您的请求。

     

请通过webmaster@mydomainname.net与服务器管理员联系   告知他们此错误发生的时间以及您的行为   在此错误之前执行。

     

有关此错误的详细信息可能在服务器错误中可用   日志中。

     

此外,遇到500内部服务器错误错误   尝试使用ErrorDocument来处理请求。

我已经尝试了CodeIgniter故障排除页面的建议,因为我怀疑我的服务器是否支持提供搜索引擎友好URL所需的REQUEST_URI变量,因为我实际上可以看到我自己的索引页面但是所有其他URL&使用CodeIgniter的#39;正在打印上述错误。

在配置文件中我有:

-------------------------------------------------------------------
| Index File
|--------------------------------------------------------------------------
|
| Typically this will be your index.php file, unless you've renamed it to
| something else. If you are using mod_rewrite to remove the page set this
| variable so that it is blank.
|
*/

$config['index_page'] = "index.php?";

/*
|--------------------------------------------------------------------------
| URI PROTOCOL
|--------------------------------------------------------------------------
|
| This item determines which server global should be used to retrieve the
| URI string.  The default setting of 'AUTO' works for most servers.
| If your links do not seem to work, try one of the other delicious flavors:
|
| 'AUTO'   Default - auto detects
| 'PATH_INFO'  Uses the PATH_INFO
| 'QUERY_STRING' Uses the QUERY_STRING
| 'REQUEST_URI'  Uses the REQUEST_URI
| 'ORIG_PATH_INFO' Uses the ORIG_PATH_INFO
|
*/
$config['uri_protocol'] = "REQUEST_URI";

在索引文件中我有:

/*
 *---------------------------------------------------------------
 * SYSTEM FOLDER NAME
 *---------------------------------------------------------------
 *
 * This variable must contain the name of your "system" folder.
 * Include the path if the folder is not in the same  directory
 * as this file.
 *
 */
 $system_path = 'pik';

/*
 *---------------------------------------------------------------
 * APPLICATION FOLDER NAME
 *---------------------------------------------------------------
 *
 * If you want this front controller to use a different "application"
 * folder then the default one you can set its name here. The folder
 * can also be renamed or relocated anywhere on your server.  If
 * you do, use a full server path. For more info please see the user guide:
 * http://codeigniter.com/user_guide/general/managing_apps.html
 *
 * NO TRAILING SLASH!
 *
 */
 $application_folder = 'sam';

如你所见,我改变了

$config['index_page'] = "index.php";

 $config['index_page'] = "index.php?"; 

然而,它没有用。

这与配置有关吗? :

/*
|--------------------------------------------------------------------------
| URI PROTOCOL
|--------------------------------------------------------------------------
|
| This item determines which server global should be used to retrieve the
| URI string.  The default setting of 'AUTO' works for most servers.
| If your links do not seem to work, try one of the other delicious flavors:
|
| 'AUTO'   Default - auto detects
| 'PATH_INFO'  Uses the PATH_INFO
| 'QUERY_STRING' Uses the QUERY_STRING
| 'REQUEST_URI'  Uses the REQUEST_URI
| 'ORIG_PATH_INFO' Uses the ORIG_PATH_INFO
|
*/
$config['uri_protocol'] = "REQUEST_URI";

此外,我该怎么做才能在服务器上设置或添加REQUEST_URI支持?
任何帮助将非常感谢!

0 个答案:

没有答案