502 Bad Gateway (Nginx) Issue
After uninstalling PHP (7.0.33-58+ubuntu18.04.1+deb.sury.org+1) package and reboot the server as per recommendation from Linode support as to have the newer version of PHP 7.4 to take control, the website is not longer accessible due to "502 Bad Gateway(nginx)" error. I've tried installing back PHP 7.0 package back but the issue still persist.
Troubleshooting done:
Nginx service is running - Tried restarting/reloading the service
Apache service is not running at the same time
Nginx is listening to port 443 and 80
Php7.0-fpm service is running - Tried restarting/reloading the service
Php7.4-fpm service is running - Tried restarting/reloading the service
I've tried stopping php7.0-fpm and php7.4-fpm service running at the same time enabling each version at a time. However, that also didn't resolve the issue.
How do I fix this?
1 Reply
Do php70-fpm & php74-fpm use the same socket/port? Do you use the same nginx (boilerplate) config to interface with both of them? Does nginx interface with them at all?
You only need one of these…the one that matches your chosen php version.
Just FYI, if you’re after the latest & greatest, php is up to 8.1 now. I’ve read/heard that new(er) versions of WP require php 8.0 or better these days.
—sw