#24334 [NEW]: php.ini settings override php-cli.ini settings
From: otacon at octo dot sytes dot net
Operating system: FreeBSD 4.8
PHP version: 4.3.2
PHP Bug Type: Feature/Change Request
Bug description: php.ini settings override php-cli.ini settings
Description:
------------
Let me just emphasize now that this is not a bug, just an example
leading into a change request.
Example Scenario:
When fgets(STDIN, [int]) is called in a PHP (CLI) shell script, the
script will not display previous output if the output buffer has not been
filled. The user is then left at a prompt, and the script pauses,
expecting input. This can be avoided by setting the "output_buffering =
0" in php.ini, or by adding ob_flush_implicit(true) to your script and
adding ob_flush() before every call to STDIN.
Change Request:
The second method makes for messy scripts. The first method
completely solves this, but only by editing php.ini because
output_buffering() may not be changed on-the-fly with ini_set().
Because the manipulated variable, "output_buffering = ...", affects
both environments, I am suggesting allowing an option for php-cli.ini to
override settings in php.ini.
php-cli.ini, in my php configuration directory, is parsed as an additional
file, but the values from php-cli.ini are overrided by the values in
php.ini. There is no independence of the CLI and webserver
environment, each of which is unique (static vs. dynamic). So, in this
case, I would not be able to choose output_buffering enabled for
webserver, and disabled for CLI.
Another instance of this problem arising could be in PHP-Gtk, yet
another dynamic user-interface involved in PHP development.
If it is at all possible to do this with PHP-4.3.2, (other than using the
redundant ob_flush() method), please inform me.
Patrick Clery
--
Edit bug report at http://bugs.php.net/?id=24334&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=24334&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=24334&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=24334&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=24334&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=24334&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=24334&r=support
Expected behavior: http://bugs.php.net/fix.php?id=24334&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=24334&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=24334&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=24334&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24334&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=24334&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=24334&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=24334&r=gnused
Thread (2 messages)
- otacon at octo dot sytes dot net