WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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)));


share|improve this question
ah... it is the https ... doesnt like that – edelwater Feb 8 '11 at 2:05
up vote 3 down vote accepted

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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