I see if some MP3s exist but sometimes there is no problem, some valid mp3 The files are shown as 404, not found. Here's the code I'm using:
$ ch = @curl_init ($ file_path); @curl_setopt ($ CH, CURLOPT_HEADER, true); @curl_setopt ($ CH, CURLOPT_NOBODY, true); @curl_setopt ($ CH, CURLOPT_FOLLOWLOCATION, true); @curl_setopt ($ CH, CURLOPT_RETURNTRANSFER, TRUE); @curl_exec ($ ch); $ Header = curl_getinfo ($ ch); Curl_close ($ ch); Echo "& lt; east & gt;"; Print_r ($ header); Echo "& lt; east & gt;"; I thought the problem was that the sites were using redirects, but setting the TRUE to "CURLOPT_FOLLOWLOCATION" did not resolve the issue. The http code 404 shows that on the following mp3s you can go from them in your browser and see that they work. These are some random examples of many people who have this problem:
Basically:
@curl_exec ($ ch);
You consider curl to be run properly, and throw its return value. If there was a problem in querying, then the error returns false and curl_error and the curl_errno will include diagnostic information, which how to fly and how sometimes the curl does not succeed, many of its causes can fail, but only one way to succeed At least, change your code to:
if (curl_exec ($ ch) === incorrect) {dead ("curl error:". Curl_error ($ ch)); }
To see why things died, otherwise you have just left it with strange results and have seen why they have come.
Comments
Post a Comment