php include problem
When i try to load a page that resi开发者_如何学Godes in /var/www/vhosts/mypage/httpdocs/index.php using a browser I get an include error that it cannot include file which is in /var/www/fw/trunk.
include path is set to include_path='.:/var/www/fw/trunk'.
But when I try to load it from console using 'php index.php' it loads fine, i guess it some kind of a permission problem but I can't seem to find what and where.
You need to make sure that the webserver or php process is able to read the folder an the files at least.
Search for chown
and chmod
.
I found a solution, it was this thing I had to put in a config file for that virutal host:
php_admin_value safe_mode off
php_admin_value open_basedir none
Your web server is probably accessing the file system as www-data. You should make sure /var/www/fw/trunk is readable by that user or group.
You can test this by switching to the www-data user and manually viewing the file.
As root, you can switch user without knowing the password.
su www-data
If you encounter a directory you can not traverse as www-data, your web app will also fail there. You can use chmod to open the directory.
Does the page you're trying to include compile?
Otherwise, make sure that read and execute permission is given to everyone.
精彩评论