私はこのリンクからjsonをカールさせようとしています:http ://web-app.usc.edu/ws/soc/api/departments/20131
私はもう試した:
file_get_contents:
$json = file_get_contents("http://web-app.usc.edu/ws/soc/api/departments/20131");
カール:
$ch = curl_init('http://web-app.usc.edu/ws/soc/api/departments/20131');
$response = curl_exec($ch);
しかし、file_get_contentsは「ストリームを開くことができず」、curlがハングしているように見えます。興味深いことに、ターミナルでURLをカールさせることは問題なく機能します。
何が問題なのですか?