php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #49375 Mass Virtual Hosting Enhancements
Submitted: 2009-08-26 15:07 UTC Modified: 2021-09-26 04:22 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: hervec at gmail dot com Assigned: cmb (profile)
Status: No Feedback Package: Apache2 related
PHP Version: 5.2.10 OS: Linux
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 — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
38 - 34 = ?
Subscribe to this entry?

 
 [2009-08-26 15:07 UTC] hervec at gmail dot com
Description:
------------
I want to be able to set open_basedir value with apache environmental variable. This can permit to do dynamic restriction, like restrict acces to the DOCUMENT_ROOT value

There was plenty of patches before, who never come to vanilla...


Reproduce code:
---------------
php_admin_value open_basedir "$DOCUMENT_ROOT"
or if you prefer
php_admin_value open_basedir "$SERVER['DOCUMENT_ROOT']"

Expected result:
----------------
restrict access to file in DocumentRoot

Actual result:
--------------
not working

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-08-26 15:11 UTC] jani@php.net
To have per-host / per-dir settings, just upgrade to PHP 5.3 which already has this feature set for FastCGI.


 [2009-08-26 15:39 UTC] hervec at gmail dot com
this is not dynamic, it force me to declare more than 1500+ vhost like this :
[HOST=example.com]
php_admin_value open_basedir "/home/example.com"

it is painful !

I want it more like this :

[HOST=_default_]
php_admin_value open_basedir "/restrict"
[HOST=*]
php_admin_value open_basedir "/home/$HOST"

Or maybe using Regex in HOST=

[HOST="^([^.]+\.)*([^\.]+\.[^\.]+)$"]
php_admin_value open_basedir "/home/$2"

is it possible ?
 [2010-11-24 14:53 UTC] jani@php.net
-Summary: Mass Virtual Hosting Enhancements ? +Summary: Mass Virtual Hosting Enhancements -Package: Feature/Change Request +Package: Apache2 related
 [2021-09-14 13:56 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-09-14 13:56 UTC] cmb@php.net
> is it possible ?

Maybe, but open_basedir isn't a security feature[1], so you're
likely looking for the wrong solution, especially if this is about
shared hosting, what it appears to be.

[1] <https://www.php.net/manual/en/ini.core.php#ini.open-basedir>
 [2021-09-26 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 14:01:29 2024 UTC