#36810 [NEW]: ini_set() returns FALSE, even upon success, if the option wasn't set in php.ini
From: djslakor at hotmail dot com Operating system: win32 PHP version: 4CVS-2006-03-21 (snap) PHP Bug Type: PHP options/info functions Bug description: ini_set() returns FALSE, even upon success, if the option wasn't set in php.ini Description: In my example, I wanted to modify the user_agent fopen wrapper option in order to spoof a user_agent (obviously). In my current php.ini configuration, the user_agent line is commented out. When issuing ini_set(user_agent, Mozilla), for example, the function returns false, although it succeeds. The documentation states the function is to return the previous value for the option, however, in this case, since the option was not set to begin with, it returns false, which indicates failure (although the call was a success). This does not make sense. Reproduce code: --- Pre-req: user_agent must be commented out in php.ini $blah = ini_set(user_agent, Mozilla); var_dump($blah); Expected result: I expect the function to successfully set user_agent to Mozilla, which in this case it does, and return something other than false, which indicates failure. [3 Sep 2002 3:54pm CEST] [EMAIL PROTECTED] What's the bug here? If some ini setting is not set at all, what should be returned else than false? Response: Perhaps if the option is not already set, instead of returning false, it should simply return the value you just set the option to. This would be better than indicating a failure when one doesn't exist. Actual result: -- Returns false. -- Edit bug report at http://bugs.php.net/?id=36810edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=36810r=trysnapshot44 Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=36810r=trysnapshot51 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=36810r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=36810r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=36810r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=36810r=needtrace Need Reproduce Script:http://bugs.php.net/fix.php?id=36810r=needscript Try newer version:http://bugs.php.net/fix.php?id=36810r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=36810r=support Expected behavior:http://bugs.php.net/fix.php?id=36810r=notwrong Not enough info: http://bugs.php.net/fix.php?id=36810r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=36810r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=36810r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36810r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=36810r=dst IIS Stability:http://bugs.php.net/fix.php?id=36810r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=36810r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=36810r=float No Zend Extensions: http://bugs.php.net/fix.php?id=36810r=nozend MySQL Configuration Error:http://bugs.php.net/fix.php?id=36810r=mysqlcfg
#31082 [Bgs]: PHPRC variable has no affect
ID: 31082 User updated by: djslakor at hotmail dot com Reported By: djslakor at hotmail dot com Status: Bogus Bug Type: *Configuration Issues Operating System: Windows XP Professional SP 2 PHP Version: 4.3.10RC2 New Comment: Indeed I am using Apache 1.3.33, in which the below description applies. I suppose the feature only works with Apache2? Thanks, -djs Previous Comments: [2004-12-15 01:20:54] [EMAIL PROTECTED] If you're using Apache2 you can always add this to your httpd.conf: PHPINIDir conf The Apache 2.0 PHP module supports a new configuration directive that allows an admin to override the php.ini search path. For example, place your php.ini file in Apache's ServerRoot/conf directory and add this to your httpd.conf file: PHPINIDir conf Also, you can specify it in registry..also mentioned in install.txt. Check also that php.ini is readable by the user as what your webserver runs as. In any case, PHPRC works fine here, so no bug here either. [2004-12-14 05:12:44] djslakor at hotmail dot com Description: As documented in install.txt: Adding: SetEnv PHPRC C:/php to httpd.conf OR setting PHPRC as a system variable both have no affect in changing the location of php.ini. For example, if php.ini resides in C:/php, using either of the above methods does not work, and default values are loaded instead. php.ini _is_ however recognized if it is placed in %systemroot% or the web server root (i.e. c:\apache). Thanks -- Edit this bug report at http://bugs.php.net/?id=31082edit=1
#31082 [NEW]: PHPRC variable has no affect
From: djslakor at hotmail dot com Operating system: Windows XP Professional SP 2 PHP version: 4.3.10RC2 PHP Bug Type: *Configuration Issues Bug description: PHPRC variable has no affect Description: As documented in install.txt: Adding: SetEnv PHPRC C:/php to httpd.conf OR setting PHPRC as a system variable both have no affect in changing the location of php.ini. For example, if php.ini resides in C:/php, using either of the above methods does not work, and default values are loaded instead. php.ini _is_ however recognized if it is placed in %systemroot% or the web server root (i.e. c:\apache). Thanks -- Edit bug report at http://bugs.php.net/?id=31082edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=31082r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=31082r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=31082r=trysnapshot51 Fixed in CVS:http://bugs.php.net/fix.php?id=31082r=fixedcvs Fixed in release:http://bugs.php.net/fix.php?id=31082r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=31082r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=31082r=needscript Try newer version: http://bugs.php.net/fix.php?id=31082r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=31082r=support Expected behavior: http://bugs.php.net/fix.php?id=31082r=notwrong Not enough info: http://bugs.php.net/fix.php?id=31082r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=31082r=submittedtwice register_globals:http://bugs.php.net/fix.php?id=31082r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=31082r=php3 Daylight Savings:http://bugs.php.net/fix.php?id=31082r=dst IIS Stability: http://bugs.php.net/fix.php?id=31082r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=31082r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=31082r=float MySQL Configuration Error: http://bugs.php.net/fix.php?id=31082r=mysqlcfg