Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

open_basedir hurting my head 1

Status
Not open for further replies.

roycrom

Programmer
Aug 2, 2002
184
GB
Hi all,

I am pretty sure I understand how the open_basedir directive works but I am still struggling with it.

I have safe mode turned OFF, open_basedir commented out and include_path set to ".:/usr/local/php" in php.ini.

The only part of my apache configuration that I am using open_basedir is in my vhosts.conf as follows
Code:
<VirtualHost *:80>
 ServerAdmin webmaster@mydomain.com
 DocumentRoot /g01/inet/htdocs/basetest
 ServerName basetest.mydomain.com
 php_admin_flag open_basedir /g01/inet/htdocs:/usr/local/php
</VirtualHost>
I have put a test.php file at /g01/inet/htdocs/basetest/test.php but when I browse to it I still get the message
Code:
Warning: Unknown: open_basedir restriction in effect. File(/g01/inet/htdocs/basetest/test.php) is not within the allowed path(s): (0) in Unknown on line 0

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

Fatal error: Unknown: Failed opening required '/g01/inet/htdocs/basetest/test.php' (include_path='.:/usr/local/php/lib/php') in Unknown on line 0
I thought it may be the '.' in the include_path but I have tried it without that too,
Can anyone see where I am going wrong?
I have also tried setting open_basedir to only / but this still doesn't work which just stumps me.

------------------------------------------
Somethings come from nothing, nothing seems to come from somethings - SFA - Guerilla

roycrom :)
 
i don't think that you are using the right directive. the _flag directives are for setting boolean values and i think it's best to enquote attribute values. please try, instead

Code:
php_admin_value open_basedir "/g01/inet/htdocs:/usr/local/php"
 
jpadie you genius!

I thought I had tried that (actually, I think it was just php_flag).

Thanks a lot, works perfectly when php_admin_value is used.
I can confirm that it also works with or without the quotes on apache 1.3, php5 and linux at any rate. I imagine it would be needed if white space was in the directories though.

Thanks again

p.s. star for you :)

------------------------------------------
Somethings come from nothing, nothing seems to come from somethings - SFA - Guerilla

roycrom :)
 
oops, i meant php_value

------------------------------------------
Somethings come from nothing, nothing seems to come from somethings - SFA - Guerilla

roycrom :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top