Dynamic open_basedir and mod_vhost_alias
| From: | Alex Domoradov | Date: | Mon, 02 Apr 2012 11:47:21 +0000 |
| Subject: | Dynamic open_basedir and mod_vhost_alias | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-317423@lists.php.net to get a copy of this message | ||
Maybe anyone can point me in the right direction.
I need to modify this patch
http://www.phpbuilder.com/lists/php-developer-list/2000101/0994.php
and replace VIRTUAL_DOCUMENT_ROOT with real path.
As described in patch note - "When using mod_vhost_alias the
DOCUMENT_ROOT = PATH_TRANSLATED -
SCRIPT_NAME(request_uri)"
But in fact this is not always true. If we used any redirection
(mod_rewrite) for example, in the request_uri would be modified uri
For example
1. Without any redirects
url - http://project.domain.com/subdir1/test.php
SG(request_info).path_translated=/var/www/vhosts/project/subdir1/test.php
SG(request_info).request_uri=/subdir1/test.php
Looks everything is ok.
doc_root = strncpy( real_open_basedir_path,
SG(request_info).path_translated,
strlen(SG(request_info).path_translated) -
strlen(SG(request_info).request_uri) );
2. With some kind of redirects
url - http://magento.domain.com/index.php
SG(request_info).path_translated=/var/www/vhosts/magento/index.php
SG(request_info).request_uri=/index.php/install
And that is a BIG problem.
So my question. Could we get in php, maybe through apache API original
uri or doc_root? So latter we can replace VIRTUAL_DOCUMENT_ROOT in
PG(open_basedir) with the real path?