1

I am trying to test if the remote images exist before I process my codes..

I have found this post

How can one check to see if a remote file exists using PHP?

I have tried getimagesize function and file_get_contents function but I got

Warning: getimagesize() [function.getimagesize]: http:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /project/testImages.php on line 147

I can't modify the server configuration in my case.

I am not sure how to solve the errors or if there are another ways to workaround.

Thanks for any help.

Community
  • 1
  • 1
Rouge
  • 4,181
  • 9
  • 28
  • 36

1 Answers1

0

Why don't you try cURL with CURLOPT_HEADER set to 1 (or true)? Then just check the returned contents for server response. That's the way I'd do it.

Serj Sagan
  • 28,927
  • 17
  • 154
  • 183