且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

curl错误:警告:curl_exec():45不是有效的cURL句柄资源

更新时间:2023-02-24 15:12:09

您的代码运行正常。

如您所见,图像.. Google阻止了您IP地址中的请求,因为它检测到异常的流量活动。

As you can see the image.. Google have blocked the request from your IP address as it detected unusual traffic activity.

您始终可以检查您的请求URL给出的HTTP状态代码。

You can always check the HTTP Status Code what your requesting URL gives by..

echo $http_status = curl_getinfo($curl, CURLINFO_HTTP_CODE);

如果一切正常,您将得到 200 响应,否则您将获得一些其他状态代码。

If everything is normal , you would get a 200 response, else you will get some other status code.

以下是最常见的HTTP状态代码。

Here are the most common HTTP Status Codes..