cURL failureonerror,失败并且不记录任何错误
我正在 PHP 中使用 libcurl 库创建一个网站抓取工具...抓取工具随机挂起,因此我使用 CURLOPT_VERBOSE => 启用了详细错误日志记录真的, CURLOPT_STDERR =>; $flog
很好,但是刮刀挂起了,所以我又启用了一项设置 CURLOPT_FAILONERROR =>; true
现在,当刮刀遇到错误时,它会突然停止,但存储在临时文件夹中的文本文件中的 CURLOPT_STDERR 中不会记录任何错误。如果我禁用 FAILONERROR 它只会挂在那里,我不会收到任何错误,所有成功响应。任何人都知道如何记录失败错误发生的错误,或者它们可能存储在哪里?
I'm using the libcurl library in PHP to create a website scraper...the scraper gets hung up randomly, and so I've enabled verbose error logging using CURLOPT_VERBOSE => true,
which is fine, but the scraper is getting hung up so I've enabled one more setting
CURLOPT_STDERR => $flogCURLOPT_FAILONERROR => true
now the scraper stops abruptly when it hits an error but no error is recorded in the CURLOPT_STDERR which is being stored in a textfile in the temporary folder. If I disable FAILONERROR it just hangs there and I don't get any errors, all success responses. Anyone have any idea on how to log the errors that occur with failonerror, or where they might be stored?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您确保 php.ini 中的设置了吗?我认为你必须检查错误回显是否已关闭。
php-ini-error-settings
Did you ensured settings in your php.ini ? I think you have to check whether error echoing is turned off.
php-ini-error-settings