Welcome Guest, Not a member yet? Register   Sign In
[SOVLED] CI in a subfolder?
#1

[eluser]supermogx[/eluser]
I've searched the forum for this (it seems basic to me) and didn't find anything...

I've installed code igniter in a subfolder because I have something else at the root of my website. I have a wordpress install at http://www.mysite.com/ and I want to acces the codeigniter application at http://www.mysite.com/my_subfolder

1. I've change the .htaccess of Wordpress to let the request to "my_subfolder" pass
2. I've changed the .htaccess to point to /my_subfolder/index.php instead of /index.php in the codeigniter subfolder.

The application runs OK until it tries to use a class that is supposed to be in CI's "librairies" folder. I get a : Unable to load the requested class: my_class

Any idea? Any doc somewhere on how to install CI in a subfolder?

Thank you!
#2

[eluser]theprodigy[/eluser]
what is the name of your controller that you are trying to access?
have you tried accessing it with different capitalization? (on some servers www.domain.tld/Products is different then www.domain.tld/products)?
does it say "Unable to load the requested class" or "Unable to load the requested file"?

If it says "file", check the naming of your view you are trying to call.
If it says "class", check things like libraries.
#3

[eluser]helmutbjorg[/eluser]
Doesn't sound like a problem with the subfolder...
#4

[eluser]supermogx[/eluser]
The controllers are working fine. It's when I try to instantiate a custom library inside a controller that it doesn't work. And it works fine if I put it at the root of the website though.
#5

[eluser]helmutbjorg[/eluser]
Have you set your base_url properly? Also... perhaps try this with a fresh install of codeigniter...
#6

[eluser]danmontgomery[/eluser]
I have CI installed in a subfolder and the only thing I did was change $config['base_url'] and the RewriteBase in htaccess... Can you post some actual code where you're loading the library and/or an error message?

The only time you should be using MY_ is if you're extending an existing library, and even then you shouldn't be loading it with the MY_ extension, you should be loading it normally...
#7

[eluser]supermogx[/eluser]
Thanks, I think it was due to "MY_" prefix (I was not extending another CI class). Smile




Theme © iAndrew 2016 - Forum software by © MyBB