php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #24334 php.ini settings override php-cli.ini settings
Submitted: 2003-06-25 07:38 UTC Modified: 2016-03-27 07:16 UTC
Votes:4
Avg. Score:3.0 ± 0.7
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:1 (33.3%)
From: otacon at octo dot sytes dot net Assigned: krakjoe (profile)
Status: Closed Package: *General Issues
PHP Version: 4.3.2 OS: FreeBSD 4.8
Private report: No CVE-ID: None
 [2003-06-25 07:38 UTC] otacon at octo dot sytes dot net
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 


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-03-27 07:16 UTC] krakjoe@php.net
-Status: Open +Status: Closed -Package: Feature/Change Request +Package: *General Issues -Assigned To: +Assigned To: krakjoe
 [2016-03-27 07:16 UTC] krakjoe@php.net
SAPI specific files are independent ... I'm not sure when this change happened ... sorry about the wait :)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 06:01:32 2024 UTC