I'm trying to get an image from Google but...

wp_remote_get returns me:

Could not open handle for fopen() to 

I don't know why:

  • when I enter the url directly I do get results.
  • all other wp_remote_gets in the same class work ok so yes php.ini allow=ok

this is the code i run:

$referer_url = get_bloginfo('url');
$referer = $parsed_url[host];                   
$google_images_url = self::GOOGLE_IMAGES_URL . "&q=" .  $url_to_look_for . "&key=" . $key . "&userip="  . $_SERVER['REMOTE_ADDR'];
$response = wp_remote_get($google_images_url, array( 'headers' => array( 'Referer' => $referer)));


  • ah... it is the https ... doesnt like that
    – edelwater
    Feb 8, 2011 at 2:05

1 Answer 1


Yep, I experienced that under some network configurations https links fail (my case was behind proxy server).

You can use Core Control plugin to test available HTTP transports and disable glitchy one. In my case bumping transport to curl solved issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.