PHP Curl script works from browser, doesn't work as Cron Job

前端 未结 1 753
孤街浪徒
孤街浪徒 2021-01-22 19:33

I have a very simple PHP script that is supposed to make a POST request. The code is the following:

$ch = curl_init();
curl_setopt($ch,CURLOPT_URL, $url);
curl_s         


        
相关标签:
1条回答
  • 2021-01-22 20:07

    It turned out to be an authentication problem. I solved it by adding the following two lines to the CURL configuration:

    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
    

    Hope it helps someone.

    0 讨论(0)
提交回复
热议问题