homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

open basedir
Cannot reach a dir

 8:51 pm on Sep 20, 2012 (gmt 0)

I need to access from root
/var/www/vhosts/aaaaaaa.com (fake DN for WebmasterWorld!)

I do not understand why
In php.ini open basedir is commented
there is no ref to open basedir in httppd
I have all access, SSH etc..

what could I do? I got:

Warning: include() [function.include]: open_basedir restriction in effect.
File(/var/www/vhosts/aaaaaa.com/test2.php) is not within the allowed path(s): (/var/www/vhosts/aaaaaa.com/httpdocs/:/tmp/) in /var/www/vhosts/aaaaaa.com/httpdocs/test.php on line 2



 1:44 pm on Sep 24, 2012 (gmt 0)

You need to add that path to your Apache configuration. HOWEVER! The "httpdocs" is likely already set as your root path (this looks like a Plesk configuration) so you probably will NOT want to be dropping included files in that lower level directory. You are better off creating a new directory and adding THAT to your open_basedir path. Something along these lines ...
<Directory /var/www/vhosts/@domain_name@/httpdocs> 
php_admin_flag engine on
php_admin_value open_basedir "/var/www/vhosts/@domain_name@/httpdocs/:/tmp/:/var/www/vhosts/@domain_name@/my_includes/"

Don't forget to restart the HTTP server for the configuration directives to take effect.


 3:46 pm on Sep 24, 2012 (gmt 0)

Thanks Coopster.
I had added the dir already, but was not able to reach it
adding your suggestion did it!
(yes it is a PLESK)

<edit> Forgot to mention</edit>
I reach the dir from a config script
using your:
realpath($_SERVER['DOCUMENT_ROOT'] . '/../any_dir/')
. ini_get ('include_path'));


Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved