WordPress + Phoogle + Dreamhost, Problems and Solutions.

I’m currently building a brochureware site based on my buddy‘s wordpress-come-CMS which he has dubbed “Redstart”. The beauty of building a site on top of wordpress‘ architecture is that all of the cool handy plugins that have been written for bloggers are now at your disposal!

So this particular site is calling for a google maps implimentation. Not that this is difficult by any stretch, but having a plugin pre-built to allow easy management from the wordpress console would be handy. Enter Phoogle. Phoogle allowed for next to instantaneous setup of a google maps implimentation. Simply provide it with an API key, make a few calls with the desired locations to map, and it does the rest. Worked beautifully.

The problem arose when I went to move to my staging server. I was receiving “file_get_contents” errors, with reference to my server configuration. Luckily, my host Dreamhost has a pretty handy wiki for these types of problems. This article turned up my solution:

The line $addressData = file_get_contents($apiURL.urlencode($address));

needed to be replaced by this convoluted piece of crud,

$ch = curl_init();
$timeout = 0; // set to zero for no timeout
curl_setopt ($ch, CURLOPT_URL, $apiURL.urlencode($address));
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$addressData = curl_exec ($ch);
/Note the added space between the function and the left parens. this will need to be removed in production/
curl_close($ch);

Why, you might ask, well the wiki says the following: In a measure to improve security, DreamHost has disabled the PHP option allow_url_fopen. This would normally allow a programmer to open, include or otherwise use a remote file using a URL, rather than a local file path. The cURL library provides a feature-rich alternative.

So it’s not totally pointless, but it does mean that the cURL solution (7 lines instead of 1) provides a more robust solution.

Hopefully this helps someone else.

[tags]wordpress, redstart, concept64, dreamhost, phoogle, gmaps, google maps, debugging[/tags]


Join me for my next half-day coworking workshop on 2/19.
Find out details or sign up below. Save $75 by using the code DANGER.
05
Jan 2007
AUTHOR Alex Hillman
CATEGORY

elsewhere

COMMENTS 15 Comments
  • Pingback: WebDev Kungfu » Blog Archive » Using Phoogle with Wordpress (and Dreamhost)

  • http://www.playstone.net Bruno

    Alex,

    I recently discovered Phoogle and it did save me some time, but as yourself, I also use Dreamhost as my test server and of course, came across the same file_get_contents problem.

    Just wanted to let you know that this solution came as a blessing after trying to resolve this issue in a different way.

    Keep up the good work :-) Thanks, Bruno.

  • http://www.playstone.net Bruno

    Alex,

    I recently discovered Phoogle and it did save me some time, but as yourself, I also use Dreamhost as my test server and of course, came across the same file_get_contents problem.

    Just wanted to let you know that this solution came as a blessing after trying to resolve this issue in a different way.

    Keep up the good work :-) Thanks, Bruno.

  • Josh

    Thank you so much for this. Worked perfectly!

  • Josh

    Thank you so much for this. Worked perfectly!

  • Pingback: Seeker’s Jar :: Phoogle and GoDaddy: a work-around :: September :: 2007

  • http://www.typolight-blog.de Typolight

    Thanks, you nice post that helped me alot.

  • http://www.typolight-blog.de Typolight

    Thanks, you nice post that helped me alot.

  • http://free-video-clips.name/hot-xxx-girls.html hot anime xxx girls
  • http://free-video-clips.name/hot-xxx-girls.html hot anime xxx girls
  • http://filmnew.ru Jason

    Passed, senks author

  • http://filmnew.ru Jason

    Passed, senks author

  • Pingback: 2. cURL y su sintaxis URL « Tutorial CakePHP informal, sobre la marcha. ¡Participa!

  • http://karma-royal-canin.pl queroeropoo

    Good information to me.

  • penisenlargementdevice

    SizeGenetics is a medical penis enlargement device that effectively and safely works to increase penis size. If you want the best penis enlargement product at http://www.AmericanExtender.com