Jump to content

Warning: simplexml_load_file() Help


Coreye

Recommended Posts

What would cause this error;

Warning: simplexml_load_file() [function.simplexml-load-file]: ./core/xml2.php:37: parser error : Start tag expected, '<' not found in /home/scriptsc/public_html/projects/us/beta_1/user_system/index.php

 

The line is:

$core['XML'] = simplexml_load_file('./core/xml.php');

 

Heres the xml.php file: http://www.scriptscribes.net/projects/us/beta_1/user_system/core/xml.phps.

 

Thanks,

Corey

Link to comment
https://forums.phpfreaks.com/topic/83436-warning-simplexml_load_file-help/
Share on other sites

When simplexml loads a file, it doesn't parse it as PHP.  That means it's actually loading that file, not what that file would output if PHP were parsing it.

 

So, you need to either include that file and using ob_start and what not, capture the contents and parse them, or create a cron job to run the xml.php file and make it generate an xml file every x minutes.

 

 

Edit:  It's probably worth noting that there are other methods.....  You could run it through the cmd line and pass it through the PHP CLI for example.... Or you could get it remotely with a self reference to your server (bleh I wouldn't do that), and I'm sure there's other ways, but the two I mentioned are the two I would probably consider.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.