php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10004 PHP_INI_BEGIN overrides ini value while it probably shouldn't
Submitted: 2001-03-26 15:51 UTC Modified: 2001-07-15 12:23 UTC
From: shodan at chat dot ru Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0.4pl1 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: shodan at chat dot ru
New email:
PHP Version: OS:

 

 [2001-03-26 15:51 UTC] shodan at chat dot ru
Hello.

I'm doing an extension module for PHP. I've tried
to use API functions to access INI file strings and
found a bug (?) when default value overrides the
value present in php.ini.

More specifially, I declared
	
    PHP_INI_ENTRY("test.string", NULL, PHP_INI_ALL, NULL)

and written

    PHP_FUNCTION(show_ini_value)
    {
        char *ini;
        int len;
      
        ini = INI_STR("test.string");
        if (ini) {
            RETURN_STRINGL(ini, 1);
        } else {
            RETURN_STRINGL("(default), 1);
        }
    }

Everything other is exactly the default code in sample
skeleton. Now, I did

    phpize
    ./configure
    make

to build test.so, installed it and restarted Apache.
For the first time, <?=show_ini_value()?> produced
the string from php.ini. For the second time and the
following tries it replied with "(default)".

Am I doing something wrong or is this a bug in PHP?

Please reply either to my e-mail or to php-dev list.

Thanks.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-07-15 12:23 UTC] zeev@php.net
This appears to be bogus - there's probably some bug in your code, because php.ini values definitely override any defaults in the INI mechanism macros.

Please send a self-contained file that reproduces this behavior to php-dev, and we'll discuss it there.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Sep 27 00:01:27 2024 UTC