MalcolmCowen
July 12th, 2009, 05:28 PM
I want to use the PHP include statement to include a file held two levels up, but it fails and I can't see why.
I've copied a working PHP website to my new Ubuntu (Hasty) system to work on it. At the start of each path a config file is read from 2 levels up with
include("../../Config.php");
On my Ubuntu system this translates to
/var/www/includes/Setup.php calling
/var/Config.php
except that it doesn't work.
If I use include("/var/Config.php");, then it works, but then it wouldn't work on the live site.
I've even set all 3 lots of permissions to anyone can read and write anything for all directories and files involved (this system is behind a firewall) and it still fails.
Is there something that stops ".." going above the www level, or is there something about permissions I don't know?
I've copied a working PHP website to my new Ubuntu (Hasty) system to work on it. At the start of each path a config file is read from 2 levels up with
include("../../Config.php");
On my Ubuntu system this translates to
/var/www/includes/Setup.php calling
/var/Config.php
except that it doesn't work.
If I use include("/var/Config.php");, then it works, but then it wouldn't work on the live site.
I've even set all 3 lots of permissions to anyone can read and write anything for all directories and files involved (this system is behind a firewall) and it still fails.
Is there something that stops ".." going above the www level, or is there something about permissions I don't know?