PHP fatal error: Uncaught exception 'Exception' with message

前端 未结 5 1850
清酒与你
清酒与你 2021-01-19 08:13

I have a PHP script that connects to an api and posts information to their systems, but when its trying to connect it throws a fatal error:

Fatal error: Unca         


        
5条回答
  •  被撕碎了的回忆
    2021-01-19 08:34

    First error message suggests problems with apitestserver - it returns error code 500, which states for "Internal server error".

    Second one informs that PHP can't resolve host name into IP address - I'd look into DNS configuration and/or hosts file.


    Apparently 'fopen' function does not return proper stream. There can be many possibilities when that happens, but according to PHP manual, fopen function on fail should present E_WARNING message with proper commentary. It is possible that you have errors of that class silenced - call error_reporting(E_ALL) at the beginning of your script and look for some relevant error messages.

提交回复
热议问题