How to get more information about error 500 - internal server error?

前端 未结 7 2222
粉色の甜心
粉色の甜心 2021-01-05 23:00

I use $ajax requests in many parts of my PHP website everything was working perfectly until few days ago all my $ajax requests start giving e

7条回答
  •  借酒劲吻你
    2021-01-05 23:37

    My guess is that the PHP process is killed by the server due to some (mis)configuration on your host (I suspect that mod_fastcgi/mod_fcgid is used; you can check this with phpinfo()). Also, you execute the call on each 10 seconds which could hit some limit. What I would do in your case:

    • Check if PHP works with mod_fastcgi/mod_fcgid (Server API field in phpinfo()).
    • Check the Apache access_log and see if a pattern exists for 500 status code for script is_it_midnight.php.
    • Try to increase the setInterval refresh time to 15s, 20s, 25s, 30s and etc. to see if there is any improvement.
    • Place error_log (memory_get_usage()); before echo json_encode($is_it_midnight); to see what is the memory usage allocated to the script (although it is very unlikely that the memory usage is a problem given the small script).

提交回复
热议问题