Anyone figure out the open_basedir restriction problem

Support/Development for PHP
jim0615
Forum User
Forum User
Posts: 15
Joined: Sat Sep 09, 2006 10:16 pm

Anyone figure out the open_basedir restriction problem

Unread post by jim0615 »

I have been reading this forum and the swsoft forum. Tried changing the vhost.conf file a few times for one domain w/o any luck. Any help is very appreciated. Would updating to 5.1.4 help?

Its a vps server with plesk 8.01 on FC4 php 5.0.4.1

Code: Select all

Warning: Unknown: open_basedir restriction in effect. File(/var/www/vhosts/jdomain.com/httpdocs/domains.com/index.php) is not within the allowed path(s): (/var/www/vhosts/domains.com/httpdocs.:/tmp) in Unknown on line 0

Warning: Unknown: failed to open stream: Operation not permitted in Unknown on line 0

Warning: Unknown: Failed opening '/var/www/vhosts/domains.com/httpdocs/domains/index.php' for inclusion (include_path='.:') in Unknown on line 0
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Unread post by breun »

Looks like you made a type in your config: I see 'httpdocs.' where I would expect 'httpdocs'. What does your vhost.conf look like?

http://kb.swsoft.com/article_41_432_en.html
Lemonbit Internet Dedicated Server Management
jim0615
Forum User
Forum User
Posts: 15
Joined: Sat Sep 09, 2006 10:16 pm

Unread post by jim0615 »

The forum seems to not let me post my vhost file. I looked at the link and tried to use that but had no luck.
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Unread post by breun »

Can you explain what you want to do? It looks like you want to include a file from one domain in another.
Lemonbit Internet Dedicated Server Management
jim0615
Forum User
Forum User
Posts: 15
Joined: Sat Sep 09, 2006 10:16 pm

Unread post by jim0615 »

No the file is just in a sub directory on the same domain.

httpdocs/domains/index.php ->this file wants to include
httpdocs/domains/inc/config.php

domains is just the name of the program directory i used. The webroot for the domain is httpdocs.


I also have a different domain with the same problem but the index file is in a subdomain and the file it calls is in the root domain.

At this point i would rather just disable this safty function, any tips on how to do this?
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Unread post by breun »

Judging from the error you're getting I still think you made a typo in vhost.conf that broke your open_basedir path. Can you post the path you set in vhost.conf? And why did you put in an alternate open_basedir path in the first place?
Lemonbit Internet Dedicated Server Management
jim0615
Forum User
Forum User
Posts: 15
Joined: Sat Sep 09, 2006 10:16 pm

Unread post by jim0615 »

breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Unread post by breun »

It doesn't really make sense to add the ..../httpdocs/domains dir, as the ..../httpdocs entry should already allow this. I would just remove that open_basedir line completely, as the default open_basedir setting is ..../httpdocs:/tmp which should work just fine.

Also, change php_flag to php_admin_flag. And I think you'd better move that display_errors line into the Directory section (in place of the currennt open_basedir line).
Lemonbit Internet Dedicated Server Management
jim0615
Forum User
Forum User
Posts: 15
Joined: Sat Sep 09, 2006 10:16 pm

Unread post by jim0615 »

It wont work with the default settings it just returns a blank page. Thats why i have been trying to change the open_basedir setting.
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Unread post by breun »

Better check your logs first to see what's wrong.
Lemonbit Internet Dedicated Server Management
jim0615
Forum User
Forum User
Posts: 15
Joined: Sat Sep 09, 2006 10:16 pm

Unread post by jim0615 »

This is from the logs:

Code: Select all

[client 69.253.65.37] PHP Warning:  Unknown: open_basedir restriction in effect. File(/var/www/vhosts/jspwebhost.com/httpdocs/domains/index.php) is not within the allowed path(s): (/var/www/vhosts/jspwebhost.com/httpdocs.:/tmp) in Unknown on line 0
[client 69.253.65.37] PHP Warning:  Unknown: failed to open stream: Operation not permitted in Unknown on line 0
[client 69.253.65.37] PHP Warning:  Unknown: Failed opening '/var/www/vhosts/jspwebhost.com/httpdocs/domains/index.php' for inclusion (include_path='.:') in Unknown on line 0
Follow this link and u will see the php errors:
http://jspwebhost.com/domains

Thanks for all the help i just am very confused why this wont work right.
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Unread post by breun »

Is this with your vhost.conf? I'm still confused about why there's a dot after httpdocs in the allowed path. I don't think it should be there.

What is the line of code you're using to include domains/index.php?
Lemonbit Internet Dedicated Server Management
jim0615
Forum User
Forum User
Posts: 15
Joined: Sat Sep 09, 2006 10:16 pm

Unread post by jim0615 »

Yes thats with my vhost.conf file. There is no . in my file but the httpd.include has this line

Code: Select all

php_admin_value open_basedir "/var/www/vhosts/jspwebhost.com/httpdocs.:/tmp"
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Unread post by breun »

That doesn't seem right. Did you add that yourself?

Running /usr/local/psa/admin/bin/websrvmng -av should regenerate the httpd.include files for all your domains.
Lemonbit Internet Dedicated Server Management
jim0615
Forum User
Forum User
Posts: 15
Joined: Sat Sep 09, 2006 10:16 pm

Unread post by jim0615 »

Ok i ran that command and it changed the httpd.include file to not have those extra .

I changed the vhost.conf file to what u suggested. But it looks like it still can't include the file it needs.

http://jspwebhost.com/domains
Post Reply