PHP 4.0 Bug #6990 Updated: loading dynamic extensions in system config causes loss of ini settings
| From: | zeev@php.net | Date: | Mon, 15 Jan 2001 15:01:41 +0000 |
| Subject: | PHP 4.0 Bug #6990 Updated: loading dynamic extensions in system config causes loss of ini settings | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-44131@lists.php.net to get a copy of this message | ||
ID: 6990
Updated by: zeev
Reported By: vorlon@netexpress.net
Status: Closed
Bug Type: PHP options/info functions
Assigned To:
Comments:
By the way - this was not a bug, but a missing feature.
This behavior was the intended (and AFAIK documented)
behavior - INI entries referring to dynamic modules had to
be written before the line that loaded the module.
Previous Comments:
---------------------------------------------------------------------------
[2001-01-15 09:43:26] sas@php.net
Fixed in CVS. Thanks for your very detailed report!
---------------------------------------------------------------------------
[2000-10-04 04:46:21] vorlon@netexpress.net
Digging deeper, I find that if REGISTER_INI_ENTRIES() and UNREGISTER_INI_ENTRIES() are called from
the RINIT and RSHUTDOWN functions respectively, there's no problem with the handling of ini
entries. But all of the extensions that ship with PHP which use these functions call them from the
MINIT and MSHUTDOWN functions instead! Is this a bug with the handling of the ini file, or is it a
bug that's common to all of the existing PHP extensions? :)
---------------------------------------------------------------------------
[2000-10-03 06:53:15] vorlon@netexpress.net
There is a bug in the ini setting handling that surfaces when dynamic extensions are loaded in the
system php.ini file. It can be reproduced with php/apxs and any extension which is built as a
shared module. After the first request handled by a given process, PHP resets all ini values to the
compiled-in defaults, and subsequently fails to reload the module-specific ini values from php.ini
when further requests arrive.
This bug ONLY affects module-specific ini values configured at the system level, and only when used
with extensions that are loaded via php.ini. It does NOT affect ini settings configured at the
per-directory or user level (PHP_INI_PERDIR, PHP_INI_USER), nor does it appear when the extension is
built-in or loaded by the user with the dl() function.
Here is a basic PHP configuration that can be used to reproduce the problem. This is not a
real-world example, but it's sufficient for debugging :)
./configure --with-apxs=/usr/sbin/apxs --with-config-file-path=/etc/httpd --enable-session=shared
Install libphp4.so and the session.so module in the appropriate directories, and add these lines to
/etc/httpd/php.ini:
extension=session.so
session.save_path = /tmp/blee
Run Apache in single-process mode (httpd -X), and create a php script that calls phpinfo(). The
first time phpinfo is loaded, session.save_path will have a local value of /tmp/blee and a master
value of /tmp. After that, it will always show the local and master value as /tmp.
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=6990