note 103840 added to ini.sections

From: Date: Fri, 06 May 2011 10:21:30 +0000
Subject: note 103840 added to ini.sections
Groups: php.notes 
Request: Send a blank email to php-notes+get-179480@lists.php.net to get a copy of this message
Just developed the probably first php.ini hack to add commands which will only be parsed before PHP 5.3 when using mod_php. <?php # Disable eAccelerator by default eaccelerator.enable = 0 # Now, to prevent incompatibilities with Zend Optimizer+, we # want to enable eAccelerator only in PHP 5.2 or lower. [HOST=*] eaccelerator.enable = 1 ?> What is happening here? In PHP 5.3, php.ini sections to set up PHP on a per host basis have been introduced: http://www.php.net/manual/en/ini.sections.php These sections only work in CGI/FastCGI mode, however there still seems to be a difference in how the php.ini file is parsed in PHP 5.2 and PHP 5.3 when using mod_php: PHP 5.3 ignores everything below the line [HOST=*], whereas PHP 5.2 does not. In the above example, PHP 5.3 only reads "eaccelerator.enable = 0" and then stops at the invalid command [HOST=*]. However, PHP 5.2 seems to ignore the invalid command and parses the whole configuration file, ending up with "eaccelerator.enable = 1". ---- Server IP: 69.147.83.197 Probable Submitter: 79.241.181.136 ---- Manual Page -- http://www.php.net/manual/en/ini.sections.php Edit -- https://master.php.net/note/edit/103840 Del: integrated -- https://master.php.net/note/delete/103840/integrated Del: useless -- https://master.php.net/note/delete/103840/useless Del: bad code -- https://master.php.net/note/delete/103840/bad+code Del: spam -- https://master.php.net/note/delete/103840/spam Del: non-english -- https://master.php.net/note/delete/103840/non-english Del: in docs -- https://master.php.net/note/delete/103840/in+docs Del: other reasons-- https://master.php.net/note/delete/103840 Reject -- https://master.php.net/note/reject/103840 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#179480) next »