php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #68022 FPM should allow multiple includes per file
Submitted: 2014-09-15 22:26 UTC Modified: -
From: manuel-php at mausz dot at Assigned:
Status: Open Package: FPM related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2014-09-15 22:26 UTC] manuel-php at mausz dot at
Description:
------------
FPM should allow multiple include directives per file. Looking at the code I see no real reason this is prohibited. The attached patch should fix this limitation and makes the code more sane (imho).

Additional I've fixed the wrong line numbers printed in case of nested includes. They are always the same.

I can also create a pull request on GitHub if that's preferred.

Test script:
---------------
This is a simple test for the wrong line numbers *only*:
# cat fpm.d/test.conf
[test]
include = etc/fpm.d/vhost.tmpl

# cat etc/fpm.d/vhost.tmpl
prefix = /var/www/$pool
user = $pool
pm = ondemand
unknown_directive=foo

Expected result:
----------------
[15-Sep-2014 21:36:49] ERROR: [etc/fpm.d/vhost.tmpl:4] unknown entry 'unknown_directive'
[15-Sep-2014 21:36:49] ERROR: Unable to include etc/fpm.d/vhost.tmpl from etc/fpm.d/test.conf at line 2
[15-Sep-2014 21:36:49] ERROR: Unable to include etc/fpm.d/test.conf from etc/php-fpm.conf at line 15
[15-Sep-2014 21:36:49] ERROR: failed to load configuration file 'etc/php-fpm.conf'
[15-Sep-2014 21:36:49] ERROR: FPM initialization failed

Actual result:
--------------
[15-Sep-2014 21:36:21] ERROR: [etc/fpm.d/vhost.tmpl:4] unknown entry 'unknown_directive'
[15-Sep-2014 21:36:21] ERROR: Unable to include etc/fpm.d/vhost.tmpl from etc/fpm.d/test.conf at line 4
[15-Sep-2014 21:36:21] ERROR: Unable to include etc/fpm.d/test.conf from etc/php-fpm.conf at line 4
[15-Sep-2014 21:36:21] ERROR: failed to load configuration file 'etc/php-fpm.conf'
[15-Sep-2014 21:36:21] ERROR: FPM initialization failed

Patches

master-fpm-multiple-include.patch (last revision 2014-09-15 22:27 UTC by manuel-php at mausz dot at)

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri Dec 13 06:01:25 2019 UTC