dfilkovi
dfilkovi

Reputation: 3091

php include problem

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.

Upvotes: 0

Views: 765

Answers (4)

Brandon Horsley
Brandon Horsley

Reputation: 8114

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.

Upvotes: 1

dfilkovi
dfilkovi

Reputation: 3091

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

Upvotes: 1

Brandi
Brandi

Reputation: 1579

Does the page you're trying to include compile?

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

Upvotes: 0

TheHippo
TheHippo

Reputation: 63189

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.

Upvotes: 2

Related Questions