ins0mniac_74 Posted December 28, 2010 Share Posted December 28, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/222794-php-wxml-n00b-fatal-error-loading-xml/ Share on other sites More sharing options...
Maq Posted December 28, 2010 Share Posted December 28, 2010 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? Quote Link to comment https://forums.phpfreaks.com/topic/222794-php-wxml-n00b-fatal-error-loading-xml/#findComment-1152204 Share on other sites More sharing options...
PFMaBiSmAd Posted December 28, 2010 Share Posted December 28, 2010 I'm wondering what lines 1-9 are that could be causing the code to run for 30 seconds. Quote Link to comment https://forums.phpfreaks.com/topic/222794-php-wxml-n00b-fatal-error-loading-xml/#findComment-1152208 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.