Help - Search - Members - Calendar
Full Version: Opening up safe_mode and open_basedir in the php.ini and httpd.conf files
The Planet Forums > Control Panels > Plesk
iguess
How do I take PHP out of safe-mode or disable
open_basedir protections??? I cant include the database files with my server. I need to enable PEAR DB module and also GD build support for php.

Following errors:

Warning: main(): open_basedir restriction in effect.
File(/usr/share/pear/DB.php) is not within the allowed path(s):
(/var/www/vhosts/gstacks.com/httpdocs:/tmp) in
/var/www/vhosts/gstacks.com/httpdocs/cpadmin/db_connect.php on line 9

Warning: main(DB.php): failed to open stream: Operation not permitted
in /var/www/vhosts/gstacks.com/httpdocs/cpadmin/db_connect.php on line
9

Fatal error: main(): Failed opening required 'DB.php'
(include_path='.:/usr/share/pear') in
/var/www/vhosts/gstacks.com/httpdocs/cpadmin/db_connect.php on line 9
jdames
Hi everyone!
I am banging my head on an open_basedir error for accessing XML_RSS located in the pear/XML/RSS.php file. Seems like open_basedir is prohibiting access, however the almighty /etc/php.ini open_basedir config is commented out, leading me to believe that it's not even turned on.


How do I allow a .php script to allow access to the path /usr/share/pear/XML/RSS.php???

Thanks people!

Joe
scooterh
in the include section of php.ini try adding /usr/share/pear to it as well.
jdames
I have tried that. No difference. Check it out:
--------------------------------------------------

Warning: main(): open_basedir restriction in effect. File(/usr/share/pear/XML/RSS.php) is not within the allowed path(s): (/var/www/vhosts/xxxxxx.com/httpdocs:/tmp) in /var/www/vhosts/xxxxxx.com/httpdocs/rss2joomla.php on line 13

Warning: main(RSS.php): failed to open stream: Operation not permitted in /var/www/vhosts/xxxxxx.com/httpdocs/rss2joomla.php on line 13

Warning: main(): open_basedir restriction in effect. File(/usr/share/pear/XML/RSS.php) is not within the allowed path(s): (/var/www/vhosts/xxxxxx.com/httpdocs:/tmp) in /var/www/vhosts/xxxxxx.com/httpdocs/rss2joomla.php on line 13

Warning: main(RSS.php): failed to open stream: Operation not permitted in /var/www/vhosts/xxxxxx.com/httpdocs/rss2joomla.php on line 13

Fatal error: main(): Failed opening required 'RSS.php' (include_path='/usr/share/pear:/usr/share/pear/XML') in /var/www/vhosts/xxxxxx.com/httpdocs/rss2joomla.php on line 13

--------------------------------------------------

The thing is it's still complaing about open_basedir, but no friggin' value is even set for open_basedir in the /etc/php.ini. Where else is open_basedir configured for vhosts w/ plesk? Thanks!

Joe
jdames
here's my php.ini include info:
-----------------------------------------
;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;

; UNIX: "/path1:/path2"
include_path = "/usr/share/pear:/usr/share/pear/XML"
-----------------------------------------


am I crazy, or this not the only file affecting php and the way it regards open_basedir?
jdames
looks like my problem was open_basedir is set in the httpd.include which resides in the vhosts/xxx.com/conf/httpd.include . Once I added the pear dir to the include directive.... ta-da!

It works.

Thanks!

Joe
Squire
http.include is going to get overwritten by Plesk often Joe. You'll want to use a vhost.conf file instead.

Lots of information about using vhost.conf both here and on the SWSoft site/forums.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.