[SOLVED] CWP 502 Bad Gateway Cwpsrv

If your VPS is running CentOS and you use Control Web Panel (CWP), you may get this error at one time or the other: 502 Bad Gateway cwpsrv

502 bad gateway cwpsrv

CWP 502 Bad Gateway Cwpsrv Error

For me, I got the error when I deleted a User through the CWP admin interface. When this error shows up, you cannot log into your CWP admin panel to carry out any tasks.

502 Bad Gateway Cwpsrv [SOLVED]

There are two ways you can solve the 502 Bad Gateway Cwpsrv error. In most cases, any 502 Bad Gateway error can be solved by running this command:

sh /scripts/restart_cwpsrv

If running the above command does not solve your problem, here’s the second option:

First off, you should check the phpfpm service to confirm that it is running. Type this command through SSH:

systemctl status cwp-phpfpm

If the service is not running and cannot start, you have to find the User that is producing the error. To do so, check this file /usr/local/cwp/php71/var/log/php-fpm.log

tail /usr/local/cwp/php71/var/log/php-fpm.log

You will see the name of User has an error (eg. stetho.conf).

Delete the file stetho.conf from /usr/local/cwp/php71/etc/php-fpm.d/users/stetho.conf   by running this command:

rm -f /usr/local/cwp/php71/etc/php-fpm.d/users/stetho.conf

After this, run the following command to start Phpfpm

systemctl start cwp-phpfpm

From here, the 502 Bad Gateway cwpsrv should have been solved.

Let me know in the comment section below whether you have any questions.


  1. Scott November 17, 2018
  2. Zaf January 19, 2019
  3. Loz January 29, 2019
    • I Cozens February 2, 2019
  4. Adam April 2, 2019
  5. mohamed May 12, 2019
  6. Pingback: CWP: 502 Bad Gateway | Blog dcyber09 May 14, 2019
  7. Trần Hùng July 14, 2019
  8. Zain Hosting August 16, 2019
  9. Terje August 19, 2019
  10. Valentin October 9, 2019
  11. Valentin Grigore April 13, 2020
  12. Renan May 14, 2020

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Get more tech stuff like this
in your inbox

Subscribe to our mailing list for occasional amazing tech stuff.

Thank you for subscribing.

Something went wrong.