Installing a CodeIgniter application in a subfolder

被刻印的时光 ゝ 提交于 2019-11-30 05:44:18

问题


I'm trying to install an application made with codeIgniter in a subfolder, so that I can access it using : http://www.domain.com/my_subfolder/ At the root, there's a Wordpress application. I edited the .htaccess of the Wordpress install to let the request go to the folder /my_subfolder/

It's working fine, the only problem I get is that CodeIgniter is unable to dynamically load the classes in the "libraries" directory. So everything in the CI application works fine until it tries to use an object declared in the "libraries" subfolder, then I get a : Unable to load the requested class: my_class

It doesn't seems that there's a parameter in the "config" folder to change that... any idea?


回答1:


What you need is to edit your CodeIgniter config.php in System > application > config.

and then edit config.php and set the property:

$config['base_url'] = "http://www.domain.com/my_subfolder/"



回答2:


Well it seems that the config param base_url should be updated. Also, I used a library with the "MY_" prefix, and I should'nt since I was'nt extending any CI class.



来源:https://stackoverflow.com/questions/2197119/installing-a-codeigniter-application-in-a-subfolder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!