Installing a CodeIgniter application in a subfolde

2019-02-13 22:55发布

问题:

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.