Page 1 of 2
Anyone figure out the open_basedir restriction problem
Posted: Wed Sep 27, 2006 8:15 pm
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
Posted: Thu Sep 28, 2006 4:44 am
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
Posted: Thu Sep 28, 2006 10:04 pm
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.
Posted: Fri Sep 29, 2006 4:37 am
by breun
Can you explain what you want to do? It looks like you want to include a file from one domain in another.
Posted: Fri Sep 29, 2006 5:35 pm
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?
Posted: Sat Sep 30, 2006 4:45 am
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?
Posted: Mon Oct 02, 2006 3:28 am
by jim0615
Posted: Mon Oct 02, 2006 3:36 am
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).
Posted: Mon Oct 02, 2006 4:20 pm
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.
Posted: Mon Oct 02, 2006 4:26 pm
by breun
Better check your logs first to see what's wrong.
Posted: Tue Oct 03, 2006 2:53 am
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.
Posted: Tue Oct 03, 2006 4:17 am
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?
Posted: Tue Oct 03, 2006 5:03 pm
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"
Posted: Tue Oct 03, 2006 5:17 pm
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.
Posted: Tue Oct 03, 2006 5:29 pm
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