PHP-FPM 503 errors (EA4)
I have followed the instructions for configuring PHP-FPM here Configure PHP-FPM with User Pools for EasyApache 4 - cPanel Knowledge Base - cPanel Documentation
Firstly PHP Info report server API as FPM/fcgi --> all good but I am getting 503 errors now.
Secondly the docs seems to cover only the main domains, how can this be implemented for subdomains (after I figured out the 503 errors obviously :))
-
I figured out the 503 issues ... mkdir -p /home/$/run/
I ran this as root and obviously the owner was root and not the user ... A missing step also missing from the docs is the session.save_path (line 225 of the $.conf file) I had to: [LIST]- Change to value to /home/$/tmp/session
- mkdir -p /home/$/tmp/session
- chown $:$ /home/$/tmp/session I'll probably need also to set up a cron to cleanup this /session once a day I see a noticeable speed improvement for websites running FPM/FastCGI API especially relating to TTFB I hope that once EA4 is fully released in 11.56, we can look forward for a script to automate this :) Now figuring out the subdomains issue...
0 -
Hi divemasterza any luck with the subdomain problem? 0 -
Actually yes :) let say the subdomain is --> sub.example.com create the following two directories: mkdir -p /etc/apache2/conf.d/userdata/std/2_4/$/sub.example.com mkdir -p /etc/apache2/conf.d/userdata/ssl/2_4/$/sub.example.com
place an fpm.conf in each of these:ProxyPassMatch "^/(.*\.php(/.*)?)$" "unix:/home/$/run/php56-fpm.sock|fcgi://127.0.0.1/home/$/public_html/sub" DirectoryIndex index.php
rebuild http conf and restart/scripts/rebuildhttpdconf; /scripts/restartsrv_httpd
To test:echo "" > /home/$/public_html/sub/info.php
Look at the output in your browser it should say FPM/FastCGI in the server API0 -
Yeah i fixed the same just before you posted that. you might be interested in following How to install PHP 7 on a cPanel/WHM driven server without breaking everything if you add --enable-opcache --enable-fpm to the ./configure part you can basically drop in php7 php-fpm as a replacement for the old php practically using all your existing php-fpm configurations. its blazingly fast! 0 -
Hello :) I am happy to see the initial issues were resolved. Thank you for updating us with the outcome. 0
Please sign in to leave a comment.
Comments
5 comments