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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: manuel-php at mausz dot at
New email:
PHP Version: OS:

 

 [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: Sun Dec 08 06:01:24 2019 UTC