tags:

views:

77

answers:

4

When i try to load a page that resides 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.

+2  A: 

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.

Hippo
Tried 777 and changed group to web server, nothing happened.
dfilkovi
+1  A: 

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.

Brandon Horsley
A: 

Does the page you're trying to include compile?

Otherwise, make sure that read and execute permission is given to everyone.

Brandi
+1  A: 

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

dfilkovi