Hi list,
i'm new on the list so im sorry if this problem has been already discussed.

I have an Apache module that, in translate_name hook, sets PHP ini values at
runtime with zend_alter_ini_entry() (mod_php).

The systems used for tests is a debian lenny, with php5.3.3 manually compiled
from debian src packages.

This is the piece of code:

if(zend_alter_ini_entry("include_path", strlen("include_path") + 1, (void
*)include,strlen(include), PHP_INI_SYSTEM, PHP_INI_STAGE_RUNTIME) != 0)
  ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, r, "zend_alter_ini_entry
failed, include_path: %s", include);

if(zend_alter_ini_entry("open_basedir", strlen("open_basedir") + 1, (void
*)openbasedir, strlen(openbasedir), PHP_INI_SYSTEM, PHP_INI_STAGE_RUNTIME) != 0)
  ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, r, "zend_alter_ini_entry
failed, open_basedir: %s", openbasedir);

It works fine for both include and openbasedir (i use r->pool for these).

But about 3-5% of requests i get this error on http requests:
Warning: require_once(): open_basedir restriction in effect.
File(/home/www-data/asdpes.it/html/wp-load.php) is not within the allowed
path(s): (:/tmp/:/usr/share/php/:.:/home/www-data/evostreaming.com/html/) in
/home/www-data/asdpes.it/html/wp-admin/admin.php on line 30

Has you can see in this case open_basedir refers to a wrong path
asdpes.it/evostreaming.com.

Plus, for some requests, i get this error in logs for open_basedir, but _never_
for "includepath" settings.
[...] [error] [client XXXX] zend_alter_ini_entry failed, open_basedir:
/home/www-data/massimobertoldo.it/html:/tmp/:/usr/share/php/:.:/home/www-data/massimobertoldo.it/html

I notice this problems since i migrated some servers from php5.2 (lenny binary)
to php5.3.3.

Any suggestion?

-- 
Simone Caruso


-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to