|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patchesphp.ini_configparser (last revision 2013-10-21 15:01 UTC by brainstorm at nopcode dot org)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-10-21 21:21 UTC] sixd@php.net
[2013-10-21 21:21 UTC] sixd@php.net
-Status: Open
+Status: Closed
[2013-11-17 09:30 UTC] laruence@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 09:00:01 2025 UTC |
Description: ------------ The following php.ini snippet is found in the newest releases of php.ini (found un downloads section and Ubuntu 13.10): ; If disabled, all PHPDoc comments are dropped from the code to reduce the ;size of the optimized code. ;opcache.save_comments=1 The space before " ;size" breaks automation systems like Ansible which tries to parse it as a correctly formatted .ini file. Test script: --------------- Apparently it only breaks with builtin MacOSX Python distribution, so you would not be able to reproduce the above exception if running GNU/Linux or others. #!/usr/bin/python import ConfigParser, os config = ConfigParser.ConfigParser() config.readfp(open('php.ini')) print config.get('PHP', 'max_execution_time') Expected result: ---------------- It should return the value of the attribute instead of raising an exception: $ python phpparse.py 30 Actual result: -------------- TASK: [ini_file dest=/etc/php5/apache2/php.ini section=PHP option=max_execution_time value=200] *** fatal: [86.50.168.69] => failed to parse: Traceback (most recent call last): File "/root/.ansible/tmp/ansible-1382344679.91-7968522912177/ini_file", line 1116, in <module> main() File "/root/.ansible/tmp/ansible-1382344679.91-7968522912177/ini_file", line 177, in main changed = do_ini(module, dest, section, option, value, state, backup) File "/root/.ansible/tmp/ansible-1382344679.91-7968522912177/ini_file", line 99, in do_ini cp.readfp(f) File "/usr/lib/python2.7/ConfigParser.py", line 324, in readfp self._read(fp, filename) File "/usr/lib/python2.7/ConfigParser.py", line 546, in _read raise e ConfigParser.ParsingError: File contains parsing errors: /etc/php5/apache2/php.ini [line 1859]: ' ;size of the optimized code.\n'