Jump to content

PHP w/XML n00b. Fatal Error loading XML


ins0mniac_74

Recommended Posts

With the following code I am getting the Fatal Error: Maximum Execution time of 30 seconds exceeded.

 

$weather_data = simplexml_load_file('ftp://ftp2.bom.gov.au/anon/gen/fwo/IDV10450.xml');
$issuedate_pre = $weather_data->xpath('amoc/issue-time-utc');
echo $issuedate_pre."\n";
$issuedate_post = DateTime::createFromFormat('Y-m-d?H:i:s?', $issuedate_pre);
echo $issuedate_post."\n";
$issuedate_unix = $issuedate_post->format('U');
echo $issuedate_unix;

 

The page reads that "Line 10" is to blame for this, that is the first line in that script.

I would have thought it might happen if the server doesn't respond, but if you go to the source of the XML it will load in a few seconds.

 

Any help on how to load the XML properly would be greatly appreciated.

 

Regards.

Link to comment
Share on other sites

When I run a file with just this in it:

 

$weather_data = simplexml_load_file('ftp://ftp2.bom.gov.au/anon/gen/fwo/IDV10450.xml');

 

the load time is only a few seconds.  Where and how are you running this?

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.