CodeIgniter Forums
FCPATH issue with multi-installation of codeigniter - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: FCPATH issue with multi-installation of codeigniter (/showthread.php?tid=52746)



FCPATH issue with multi-installation of codeigniter - El Forum - 06-25-2012

[eluser]KLODEnet di Stefano Surricchio[/eluser]
Hi,
I have some installation on my TestServer.
I want to explain this issue with a little example:

I have an installation of CodeIgniter (2.1.0) in a subfolder, "foo".
I use a library, that need to get the FCPATH in his construct.

Then, I have another installation of CodeIgniter (2.1.0) in another subfolder, "man".
Here I use the same library.

NOW... If I access to http://localhost/foo (or http://localhost/man) all works fine, but if I access to the OTHER installation, I get an error. The SECOND execution of CodeIgniter in the same Server in different subfolder, get the FCPATH of the FIRST execution. So, if I execute "foo" and then "man", to http://localhost/man the FCPATH constant results /www/foo and not /www/man. Otherwise, if I execute "man" and then "foo", to http://localhost/foo the FCPATH constant results /www/man and not /www/foo


MY SOLUTION:
in the "index.php" I set:

Code:
define('FCPATH', dirname(__FILE__));

and so, either installation works fine.