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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
21 + 24 = ?
Subscribe to this entry?

 
 [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-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 21:01:27 2024 UTC