使用curl抓取网页或图片很多次了,今天在php的“E_ALL | E_STRICT”模式下,shell下会有报错:

google搜索“+Notice: Use of undefined constant CURLOPT_GET - assumed 'CURLOPT_GET' in”,找到一篇文章《PHP CURLOPT_GET Does not Exist!》,原来,CURLOPT_GET本就不存在。
curl_setopt($ch, CURLOPT_GET, true);
注释掉改行即可。
文章详细介绍了在PHP的E_ALL|E_STRICT模式下使用curl时遇到的错误‘Notice: Use of undefined constant CURLOPT_GET-assumed CURLOPT_GET in’,并提供了解决方案。通过注释掉相关代码行即可避免错误。
812

被折叠的 条评论
为什么被折叠?



