dongxiaoyan4388 2016-04-21 19:28
浏览 40

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

First Post ! ... And I'm in need of some help :D

We are using Code-Igniter as the base frame for our website (custom tailored). The way it's programmed, we can call from the website to some files and databases that are stored outside the public folder (for security reasons), we had a domain/server transition few days back, and currently the website is broken because it's not allowing us to those calls (system_path).

After some research, I found that the possible cause for this is that my server does not support the REQUEST_URI variable. So, I did a work around, but no good results.

The main web works fine, The error I get from all the other ulrs is this one:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at webmaster@mydomainname.net to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

I have tried the suggestions of the CodeIgniter troubleshoot page, because I am in doubt that my server is supporting the REQUEST_URI variable needed to serve search-engine friendly URLs, since I can actually see my own Index page but all the other URL's with CodeIgniter are printing the above error.

On the config file I have:

-------------------------------------------------------------------
| 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";

And on the index file I have:

/*
 *---------------------------------------------------------------
 * 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';

As you can see, I changed

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

to

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

Yet, it is not working.

Is it something to do with the config in here ? :

/*
|--------------------------------------------------------------------------
| 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";

Also, what can I do to set or to add REQUEST_URI support on the server ?
Any help would be highly appreciated !

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥30 这是哪个作者做的宝宝起名网站
    • ¥60 版本过低apk如何修改可以兼容新的安卓系统
    • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
    • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
    • ¥50 有数据,怎么用matlab求全要素生产率
    • ¥15 TI的insta-spin例程
    • ¥15 完成下列问题完成下列问题
    • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
    • ¥15 YoloV5 第三方库的版本对照问题
    • ¥15 请完成下列相关问题!