【发布时间】:2023-03-23 21:41:01
【问题描述】:
这是我的代码
<?php
$url = "http://i.imgur.com/qV39tsL.gif";
$ch = curl_init();
echo $ch;
$timeout = 20;
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$content = curl_exec($ch);
curl_close($ch);
echo $content;
?>
在我的环境中,我的上网速度有点慢,所以有时我无法从 imgur 下载一些 gif。
但让我感到困惑的是,我经常收到如下错误:
**ERROR 500: Internal Server Error.**
我在stackoverflow中查了一下,PHP中的Curl不应该让服务器宕机。
那么谁能告诉我为什么会收到 ERROR 500: Internal Server Error?
谢谢~~~
【问题讨论】:
标签: php apache networking curl network-programming