The Error
I recently added a new site through ISPConfig and I was receiving 502 Bad Gateway errors when trying to access a WordPress install I was trying to set up.
Diagnosis
This error is due to the PHP endpoint not existing when the server tries to access it.
I noticed that the web .sock in /var/lib/php5-fpm was missing for the new site.
As well as the process missing when running: ps aux | grep php
Troubleshooting
Running any of the following recommended commands did not help
- service php5-fpm stop
- service php5-fpm start
- service php5-fpm restart
- service nginx restart
It threw back the following message to me: stop: Unknown instance:
The Fix
What ended up working for me was to run: sudo pkill php5-fpm; sudo service php5-fpm start
Resources
Here are the sites and articles I came across that helped
- http://jvdc.me/fix-502-bad-gateway-error-on-nginx-server-after-upgrading-php/#comment-3754
- http://serverfault.com/questions/189940/how-do-you-restart-php-fpm
One Comment
Fatal error: Uncaught Error: Call to undefined function ereg() in /var/www/clients/client1/web1/web/wp/wp-content/themes/cswartz/library/extensions/comments-extensions.php:523 Stack trace: #0 /var/www/clients/client1/web1/web/wp/wp-content/themes/cswartz/library/extensions/discussion.php(30): thematic_commenter_link() #1 /var/www/clients/client1/web1/web/wp/wp-includes/class-walker-comment.php(179): thematic_comments(Object(WP_Comment), Array, 1) #2 /var/www/clients/client1/web1/web/wp/wp-includes/class-wp-walker.php(145): Walker_Comment->start_el('', Object(WP_Comment), 1, Array) #3 /var/www/clients/client1/web1/web/wp/wp-includes/class-walker-comment.php(139): Walker->display_element(Object(WP_Comment), Array, '5', 0, Array, '') #4 /var/www/clients/client1/web1/web/wp/wp-includes/class-wp-walker.php(387): Walker_Comment->display_element(Object(WP_Comment), Array, '5', 0, Array, '') #5 /var/www/clients/client1/web1/web/wp/wp-includes/comment-template.php(2172): Walker->paged_walk(Array, '5', 0, 0, Array) #6 /var/www/clie in /var/www/clients/client1/web1/web/wp/wp-content/themes/cswartz/library/extensions/comments-extensions.php on line 523