Is there any way (e.g. with php-fpm
) to preload a php script? We use Zend Framework and Doctrine and the initialization of the frameworks takes its time (even with opcache and apcu).
So instead of initializing the framework when a HTTP request comes in, php-fpm
could start a worker with our php script that halts on a certain point and keeps everything in memory until a request comes in at which point the process will resume with the $_GET
, $_POST
etc. data injected.
Or alternatively, is there a way of reusing a php script for multiple requests?
Is this at all a thing being done by other companies working with php or do we need to focus even more on caching of php files and other parts of our application?