Say I have a script to populate the PHP APC cache when PHP is restarted, the cache is empty.
Is it possible to create a mechanism to autorun some kind of script when the master php-fpm process is started?
Open php-fpm
vim /etc/init.d/php-fpm
In the file, find the start function, add your commands at the end.
start () {
...
# Your commands here
}
Save and restart php-fpm
I have one article for you please once read it, It might be helpful to you Link
Open php-frm through CMD
Ubantu sudo gedit /etc/init.d/php-fpm
You put the code under following function.
function start {
/*
Your code here
*/
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With