|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #68048 [feature request] auto_prepend_file has "preload" mode
Submitted: 2014-09-18 22:24 UTC Modified: 2017-08-05 04:55 UTC
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: simonhf at gmail dot com Assigned:
Status: Suspended Package: *General Issues
PHP Version: 5.4.32 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.
Block user comment
Status: Assign to:
Bug Type:
From: simonhf at gmail dot com
New email:
PHP Version: OS:


 [2014-09-18 22:24 UTC] simonhf at gmail dot com
My PHP scripts include dozens of PHP files. Caching technologies like APC and opcache make this happen faster. However, it's the same include files that get included over and over again with every Apache HTTP request. The Apache child process only starts to include all the files once the HTTP request is being serviced. This means that even with the acceleration provided by APC & friends, there is still an overhead to load all the files. APC & friends just make the overhead e.g. half as much.

Request: Modify auto_prepend_file so that it prepends *before* the HTTP request is serviced. This means that once the HTTP request is made, the Apache child process already has the auto_prepend_file included files parsed and included (thus saving time), and then continues to parse and include the regular PHP script(s) to service the request.

Such a mechanism would be similar to the preload [1] mechanism in mod_perl.

Does this save CPU or RAM? No. Does it make the HTTP request faster from the perspective of the client? Yes, if Apache can keep ahead of the client request rate, i.e. always have a child process ready to go with preloaded PHP include files.



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-08-05 04:55 UTC]
-Status: Open +Status: Suspended
 [2017-08-05 04:55 UTC]
Thank you for your interest in PHP and for submitting a feature request. Please be aware that due to the magnitude of change this request requires, it would be necessary to discuss it on PHP Internals list ( as an RFC. Please read the guide about creating RFCs here:
If you haven't had experience with writing RFCs before, it is advised to seek guidance on the Internals list ( and/or solicit help from one of the experienced developers. 

Please to not consider this comment as a negative view on the merits of your proposal - every proposal which requires changes of certain magnitude, even the very successful and widely supported ones, must be done through the RFC process. This helps make the process predictable, transparent and accessible to all developers.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Jan 19 12:01:22 2021 UTC