php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6990 loading dynamic extensions in system config causes loss of ini settings
Submitted: 2000-10-03 06:53 UTC Modified: 2001-01-15 10:01 UTC
From: vorlon at netexpress dot net Assigned:
Status: Closed Package: PHP options/info functions
PHP Version: 4.0 Latest CVS (03/10/2000) OS: Linux 2.2/Apache 1.3.11
Private report: No CVE-ID: None
 [2000-10-03 06:53 UTC] vorlon at netexpress dot 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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-10-04 04:46 UTC] vorlon at netexpress dot 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? :)
 [2001-01-15 09:43 UTC] sas@php.net
Fixed in CVS. Thanks for your very detailed report!
 [2001-01-15 10:01 UTC] zeev@php.net
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.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Sep 17 12:01:27 2019 UTC