Quote:
Originally Posted by KeenAs
Hello LQ'ppl,
I am running "Ubuntu Server with LAMP" which is working well bu for some reason i'm having trouble with paths being found by PHP; for instance:
if(file_exists("../db/websitedb.php")) require_once("../db/websitedb.php");
returns false: file not found!
if i put in an absolute path to the server in a php file like "/var/www/db/websitedb.php" it finds the file as i would hope to in the first instance.
Is there a settings in the php.ini that i have changed or missed that will fix this? or is there a module that needs to be installed for it to work properly?
I don't have this problem with other linux servers used for web hosting for my clients, and apache/php in windows is fine also, so it seems strange that this isn't working under Ubuntu Server using LAMP.
Hoping someone can help...
|
Check the permissions on the directory tree, and the entire relative path too. Be sure that you can go into the docroot where the file that's calling websitedb.php is, and type in "cd ../db" successfully. If you can't, that'll cause this. Also, is that directory a symbolic link? If so, you've got to have Apache set up to follow symlinks, otherwise it will fail.
There's nothing you need to change in php.ini...you've either got a permissions, symlink, or path problem.