PHP - curl_exec hangs

后端 未结 6 2051
死守一世寂寞
死守一世寂寞 2021-02-12 14:42

I am having a strange problem with the below php function. Unfortunately this is one of those special \"Production only\" case.

function requestPost($url, $data)         


        
6条回答
  •  心在旅途
    2021-02-12 15:01

    add the following at the end your script to get the cause of failure

    if( $rawresponse === false )
        syslog( LOG_INFO , "base.php::requestPost() : ".curl_error($curlSession) );
    

    EDIT 1

    It could be an internal problem of curl. Before all check all server runtimes are up to date ( php, php-curl and apache at least). Check all their logs..... Then I would recommand comparing results between several production environment or a dev/test environment.

    Finally try to narrow down a minimal testcase that could reproduce your issue and publish full code for the test case.

提交回复
热议问题