CodeIgniter Forums
Way to keep configuration data outside of web folder - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Model-View-Controller (https://forum.codeigniter.com/forumdisplay.php?fid=10)
+--- Thread: Way to keep configuration data outside of web folder (/showthread.php?tid=69718)



Way to keep configuration data outside of web folder - kratisalgia - 01-10-2018

Is there any way to keep the 'config.php' file out of the 'application' or 'web root' directory in codeigniter.

Thanks,
-Krati


RE: Way to keep configuration data outside of web folder - Narf - 01-10-2018

Make a "public" directory alongside "application" and put your index.php in it. That's pretty much the industry standard.


RE: Way to keep configuration data outside of web folder - InsiteFX - 01-10-2018

You will need to edit the index.php file and change the folder paths
for application folder path to ../application
and the system folder path to ../system


RE: Way to keep configuration data outside of web folder - kratisalgia - 01-15-2018

Thanks for your inputs.

I want only the config.php file outside the application folder, how do i make it work?


RE: Way to keep configuration data outside of web folder - Narf - 01-15-2018

Can't make only config.php to be outside webroot, nor is there any valid reason for that.