|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #22181 open_basedir and virtual hosting
Submitted: 2003-02-12 00:30 UTC Modified: 2011-01-01 01:25 UTC
Avg. Score:4.7 ± 0.5
Reproduced:5 of 5 (100.0%)
Same Version:0 (0.0%)
Same OS:2 (40.0%)
From: dragos dot nitu at idilis dot ro Assigned: jani (profile)
Status: Closed Package: *General Issues
PHP Version: 4.3.0 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
29 - 11 = ?
Subscribe to this entry?

 [2003-02-12 00:30 UTC] dragos dot nitu at idilis dot ro
In apache, using nameserver based mass virtual hosting, I can't set open_basedir per user/virtual host basis.
Solutions like php_admin_value .:/usr/lib/php didn't work for all users (../include).

The solution that I think of is to set open_basedir to something like ".:/var/www/*/:/usr/lib/php", where '*' will be replaced by the coresponded directory from the script path.
For example '/var/www/' should have open_basedir '/var/www/'.

I made an 'works for me patch' available here:

However it wold be nice if this feature would be included in future php versions.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-11-22 13:45 UTC] creinig at sunsite dot dk
Similar problem here: We want to use php with apache2 
(mpm_worker) via fastcgi for a shared hosting setup. One 
solution to securing this is to use mod_suexec to create a 
separate pool of php instances per virtualhost. But that's 
eating tons of RAM. 
If open_basedir (and if possible also 
safe_mode_include_dir, safe_mode_exec_dir, include_path and 
upload_tmp_dir) would accept wildcards as described in the 
original requets, it would be possible to securely use one 
pool of php instances for all vhosts.
 [2011-01-01 01:25 UTC]
-Status: Open +Status: Closed -Package: Feature/Change Request +Package: *General Issues -Assigned To: +Assigned To: jani
 [2011-01-01 01:25 UTC]
It's PHP_INI_ALL nowadays.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Thu Jan 26 21:05:54 2023 UTC