1

Please help me, my server is crashed, for static files it's fine, but my server throws error 502 bad gateway for every php script run from browser. I created a simple test.php script, when I run this scrip from command line using php test.php it's working, but when I try to open it from my web address mydomainname(dot)com/test.php or ip_address/test.php it got 502 bad gateway.

Please help me or give me some suggestions about what to check. I'm so confused because everything looks normal here. I'm using php 7.3 and Ubuntu 16.04 by the way

Surono
  • 21
  • 3
  • check `/var/log/apach2/error_log` – Dhaval Purohit Sep 19 '19 at 05:38
  • 5
    What web server are you using? Nginx? Apache? Some other server? Please read [How to create a Minimal, Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example). – M. Eriksson Sep 19 '19 at 05:41
  • You most likely are using an Apache / Nginx with php-fpm setup. In that case, please check if your php-fpm service is running. If yes, please then check if your Apache / Nginx setting is correctly configured for the php-fpm backend. – Koala Yeung Sep 19 '19 at 07:11

1 Answers1

0

PHP works because you call it directly with PHP text.php When you try to open a page with a browser, you need a web server. Something like Apache or Nginx. You have an error because you are error on your web server configuration. Check the log of web server to find out the problem.

MrAdib
  • 726
  • 12
  • 21