PDA

View Full Version : Resolved Including Files Before Root Web Dir?



groog
04-13-2012, 02:30 PM
Is it possible to include files before the root web dir?

lets say I have 3 sites in a vps that look like this

/public_html/web1/ - website1.com
/public_html/web2/ - website2.com
/public_html/web2/ - website3.com

i want to include a config file from

/var/webfiles (public_html is in same dir)

or /webfiles (var is in same dir)

Is there a trick to do this? Do I need to edit the php config?

Nevermind you can. Just tested it with SSH :)

sir pannels
04-13-2012, 02:38 PM
Hi groog,

Yes you can do it, you just include the absolute path to the file..


include("/var/webfiles/config.php");

You just need to make sure that the apache user that is calling the included file has permissions to that location.

Cheers,