sshutdownow / mod-myvhost

Automatically exported from code.google.com/p/mod-myvhost
Apache License 2.0
5 stars 5 forks source link

Setting open_basedir fails #15

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
- What is the expected output? What do you see instead?

Expected output: None (in error.log)

Actual output:

Repeatedly, the following error logs for requests to every vhost I set up.

[Fri Jun 21 23:22:31 2013] [alert] [client 127.0.0.1] 
php_ini_set([open_basedir], [/path/to/rootdir/]) failed

 - What version of the product are you using? On what operating system?

Debian 6 Squeeze

mod-myvhost v.0.21-dbd

Flags (as in original Makefile):
CFLAGS = -Wc,-W -Wc,-Wall
CFLAGS+= -DDEBUG
CFLAGS+= -DWITH_PHP

Apache MPM Prefork v2.2.xx (Debian)
PHP 5.3.x (Zend Engine v2.3.x, Suhosin v0.9.xx)

 - Please provide any additional information below.

PHP is loaded before mod-myvhost.
Safe-mode is off; no open_basedir is set globally.

Setting open_basedir manually in httpd.conf directory context works without 
errors, same is true for setting it inside of a php script.

To add even more confusion, the output of phpinfo() shows the correct 
open_basedir as "Local value".

Thanks in advance!

Original issue reported on code.google.com by puck...@gmail.com on 21 Jun 2013 at 10:08

GoogleCodeExporter commented 9 years ago
It now appears to me from log analysis that this error happens only in an 
Apache alias directory on my server. I am overwriting open_basedir using 
php_value in this specific directory context. However, disabling the php_value 
statement doesn't resolve my issue at all.

I wasn't yet able to reproduce this error seperatley from the hosted 
application. However, I just checked and my application doesn't use the ini_set 
php command at all.

If I enable debug logging the error presents itself like this: 
http://pastebin.com/UawvAMV0
(Note that I stripped some informations for security reasons)

First server is starting up, afterwards the request for "img/fb.png" is 
processed without error.
The second request however is going to my alias directory - setting 
open_basedir fails now.

My alias config looks like this:

Alias /app /path/to/app/basedir
<Directory /path/to/app/basedir>
        Options FollowSymLinks
        AllowOverride All
        DirectoryIndex index.php
        <IfModule mod_php5.c>
                php_admin_value open_basedir /path/to/app/basedir:/tmp
        </IfModule>
</Directory>

Original comment by puck...@gmail.com on 22 Jun 2013 at 1:27

GoogleCodeExporter commented 9 years ago
Traced down the issue to setting open_basedir with php_value or php_admin_value.
(Forget server restart after configuration change)

Is there a possibility to include a check in the code if open_basedir is 
already set by php_value?

Original comment by puck...@gmail.com on 22 Jun 2013 at 2:23