Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:58956 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76786 invoked from network); 15 Mar 2012 12:59:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Mar 2012 12:59:56 -0000 Authentication-Results: pb1.pair.com smtp.mail=info@simonecaruso.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=info@simonecaruso.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain simonecaruso.com designates 94.23.41.186 as permitted sender) X-PHP-List-Original-Sender: info@simonecaruso.com X-Host-Fingerprint: 94.23.41.186 mail.keedra.com Linux 2.6 Received: from [94.23.41.186] ([94.23.41.186:59451] helo=mail.keedra.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BE/03-59029-CC7E16F4 for ; Thu, 15 Mar 2012 07:59:56 -0500 Received: from [192.168.1.219] (host220-210-dynamic.43-79-r.retail.telecomitalia.it [79.43.210.220]) by mail.keedra.com (Postfix) with ESMTPSA id 5DDAF2AF9A for ; Thu, 15 Mar 2012 13:59:53 +0100 (CET) Message-ID: <4F61E7C5.7030706@simonecaruso.com> Date: Thu, 15 Mar 2012 13:59:49 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: internals@lists.php.net Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Problem with zend_alter_ini_entry From: info@simonecaruso.com (Simone Caruso) 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