One small change
Posted by: Paul
It is a small addition that was working on my home server but not on my hosted website. Basically I use a web hosting package from Zen Internet, they also provide our broadband connection. The Linux based web hosting server was running PHP version 4.x and the Nucleus plugin needed libaraies only included in PHP 5.x Fortunately Zen have started upgrading the underlying servers and cPanel interface, Zen Linux Upgrade, the new platform allows PHP 5.0 as well as many other benefits over the previous version. I raised a support ticket to have my domain moved to a new serer rather than wait for my existing cPanel server to be upgraded. I requested this on Tuesday and by Thursday I was being hosted on the new platform. Nice one Zen.
So why did I need PHP 5.x? Well the weather information as I said comes from a Nucleus plugin, NP_WeatherReport, which pulls an XML feed from The Weather Channel. It uses the SimpleXML library that is part of the core php 5.0 release. Really didn't fancy re-writing the plugin to do a page scrape especially as I am new to PHP.
One problem I did have to resolve was the original plugin used the call, file_get_content which is considered a security risk by Zen Webhosting, they aren't the only ones judging by the number of hits on Google. So I had to find another call that was supported, thankfully this was in the form of the CURL library. I also found a nice blog entry explaining the basic use of CURL to grab an XML feed.
So then it was just a case of updating the plugin to use CURL instead of Get_Content.
A small addition to the site but quite a lot of changes to implement!