Avoiding php-fpm restart with Apache #3503
-
Hi, I read about the fixes to avoid the php-fpm reload/restart in this doc: But is there also a known fix for Apache 2.4? Just using php-fpm restart after a deployment works fine, but is not an option for production. |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 4 replies
-
I realize I'm a bit late in responding to this, but I ran into this exact same problem recently and have a possible solution. Apache doesn't appear to have support for this out of the box. If it does, I haven't been able to find an officially supported solution. However, the Etsy realdoc Apache module was written for this purpose. There isn't much documentation for it. But it's pretty easy to use and does the trick in my case. |
Beta Was this translation helpful? Give feedback.
-
After searching, I decided to reload
|
Beta Was this translation helpful? Give feedback.
-
Setting (Found this cheat a while ago here: PHP opcache reset + symlink-style deployment - Stack Overflow) |
Beta Was this translation helpful? Give feedback.
-
Any new methods? This seems to do the job https://github.com/gordalina/cachetool |
Beta Was this translation helpful? Give feedback.
-
Admittedly, I'm still trying to solve this problem over a year later since the other methods mentioned in this discussion (including my own suggestion) haven't worked very well. The Etsy @bilogic Conceptually, this tool looks like a strong contender to solve this problem. Thanks for the suggestion! Edit: I just saw that there's already a Deployer recipe for this. I tried it out and it does exactly what I was looking for. Nice! |
Beta Was this translation helpful? Give feedback.
-
Struggling with the same thing, I have to keep rebooting the server which isn't great. What's the most current appropriate solution for this? I'm using Laravel and Laravel Octane on my Centos 9 Stream server |
Beta Was this translation helpful? Give feedback.
-
@sts-ryan-holton The current recommendation in the docs is to set https://github.com/deployphp/deployer/blob/master/docs/avoid-php-fpm-reloading.md I wasn't able to get that to work reliably in a cPanel managed environment (AlmaLinux on a VPS in my case) and ended up using CacheTool as per bilogic's suggestion above. It can be easily integrated as a Deployer task: https://deployer.org/docs/7.x/contrib/cachetool I'm using Symfony 7.1 and Sulu 2.6. Either approach should work with Laravel as well. |
Beta Was this translation helpful? Give feedback.
-
I endup doing this and it seems to be working fine in my app.
|
Beta Was this translation helpful? Give feedback.
Admittedly, I'm still trying to solve this problem over a year later since the other methods mentioned in this discussion (including my own suggestion) haven't worked very well.
The Etsy
realdoc
module should solve the problem, but configuring it correctly caused more problems than it was worth in a WHM/cPanel environment. It required making some risky changes to how cPanel auto-generates configuration files. There's a--graceful
option when using the WHM/cPanel script to restart PHP-FPM, and that appears to not drop requests or cause them to fail.@bilogic Conceptually, this tool looks like a strong contender to solve this problem. Thanks for the suggestion!
Edit: I just saw that there's…