Jump to content

postcodeanywhere lookup on PHP 5.3.10


pcs_dmw

Recommended Posts

Firstly hello - I've not posted on here before! :)

 

I'm after a bit of advice if possible - I recently upgraded to a new server with RHEL6 and PHP 5.3.10 from a previous server with RHEL4 and PHP 5.2.17.

 

I have some postcode lookup software running that functioned perfectly on our old server, but seems to cause a server 500 error with the updated version of PHP. I cannot downgrade to PHP 5.2.17 so I need to fix the issue or workaround it. A snippet of the code is as follows:

 

$data = simplexml_load_string(file_get_contents($url));

foreach ($data->Rows->children() as $row)
{

 

I have narrowed down the cause of the failure to "children()" - it seems that anything with the curly brackets causes the code to die?

 

As you may guess I'm not a guru with PHP - I just know enough to get by. What do I need to do to get this working?

 

Many thanks in advance.

 

Danny

Link to comment
Share on other sites

Most likely your call to file_get_contents() has failed due to the fact that url wrappers are not enabled. Calling $data->Rows->children() would then fail because Rows is not an object.

 

Of course you failed to mention what the errors you are receiving are so that is simply a guess.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.