cURL + Laravel Valet + dnsmasq not working

前端 未结 5 1149
南笙
南笙 2020-12-15 08:11

when I execute a PHP script which runs a cURL request to a .test domain that is setup on my Mac with Laravel Valet/dnsmasq, I get this error printed :

5条回答
  •  萌比男神i
    2020-12-15 09:15

    Just spent the last hour on this. I had a similar problem with curl through PHP not resolving with Valet specially for SSL. I tried changing curl-openssl versions and also setting my domain in the host file etc. Nothing worked apart from the following:

        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
    

    This is due to the valet SSL not being verified by Curl. Once I added this option to my curl request I was able to fetch data from my local valet url.

提交回复
热议问题