Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Need Help Figuring Out New Module Error Message
 
oliverscarlett
Jr. Member
 
Total Posts:  15
Joined:  2008-04-10
 

I’m trying to implement a new shipping module and I keep running into this error message on the front end and admin. Can someone help figure out the meaning of this error?

The latest iteration of my new module is as per the new shipping module wiki.

Thanks!

Warningsimplexml_load_string() [function.simplexml-load-string]Entityline 1parser error XML declaration allowed only at the start of the document  in C:\xampp\htdocs\magento\lib\Varien\Simplexml\Config.php on line 494
Trace
:
#0 C:\xampp\htdocs\magento\lib\Varien\Simplexml\Config.php(494): mageCoreErrorHandler(2, 'simplexml_load_...', 'C:\xampp\htdocs...', 494, Array)
#1 C:\xampp\htdocs\magento\lib\Varien\Simplexml\Config.php(482): Varien_Simplexml_Config->loadString('      loadFile('      init('C:\xampp\htdocs...')
#4 C:\xampp\htdocs\magento\app\Mage.php(404): Mage_Core_Model_App->init(Array)
#5 C:\xampp\htdocs\magento\app\Mage.php(423): Mage::app('', 'store', Array)
#6 C:\xampp\htdocs\magento\index.php(40): Mage::run('', 'store', Array)
#7 {main}
 
Magento Community Magento Community
Magento Community
Magento Community
 
Gabriel Queiroz
Sr. Member
 
Total Posts:  135
Joined:  2008-05-28
Brasília, Brazil
 

Hi,

Can you post your xml files here? There’s something wrong with them.

Cheers,

 
Magento Community Magento Community
Magento Community
Magento Community
 
oliverscarlett
Jr. Member
 
Total Posts:  15
Joined:  2008-04-10
 

Thanks, Gabriel. Here they are.

Again, nothing sexy in this set - just straight from the wiki.

File Attachments
Mage_All.xml  (File Size: 10KB - Downloads: 112)
config.xml  (File Size: 2KB - Downloads: 126)
system.xml  (File Size: 14KB - Downloads: 126)
ShippingMethod.php  (File Size: 3KB - Downloads: 93)
 
Magento Community Magento Community
Magento Community
Magento Community
 
alistek
Sr. Member
 
Total Posts:  293
Joined:  2008-04-02
Normal, IL
 

I took a look at your files and the only thing I can find incorrect possibly is no closing php tag (?>) on your ShippingMethod.php file.

-Adam

 
Magento Community Magento Community
Magento Community
Magento Community
 
Gabriel Queiroz
Sr. Member
 
Total Posts:  135
Joined:  2008-05-28
Brasília, Brazil
 

Hi!

There are blank spaces before your “<?xml ..." tags. Try to delete them.

The missing "?>” php tag at the end of the file is allright… It’s a good practice to do it, this way your php files won’t create any undesired output at the end of the file, unless your code does it.

Cheers!

 
Magento Community Magento Community
Magento Community
Magento Community
 
oliverscarlett
Jr. Member
 
Total Posts:  15
Joined:  2008-04-10
 

@ alistek: I tried closing the tag but no luck.

@ Gabriel: I’ll remove the blanks this evening and let you know. Could it have anything to do with app/code/local not being in PHP‘s include_path?

As per the wiki: Make sure that app/code/local is in PHP‘s include_path. To do so, execute the following code, either in a shell or inside a web-accessible PHP file:
<?=get_include_path();?>

I’m just not sure how to satify this requirement.

Thanks to all!

 
Magento Community Magento Community
Magento Community
Magento Community
 
alistek
Sr. Member
 
Total Posts:  293
Joined:  2008-04-02
Normal, IL
 

Gotcha I wasn’t sure about that, I know on the database schema installation files, it does that but didn’t know about those.  app/code/local should by default be in PHP’s include_path, it would be strange if it wasn’t.  If it wasn’t then I would think not even that error would show up as that seems to be parsing the files in there anyways.  It does seem to be a specific XML error.

-Adam

 
Magento Community Magento Community
Magento Community
Magento Community
 
Gabriel Queiroz
Sr. Member
 
Total Posts:  135
Joined:  2008-05-28
Brasília, Brazil
 

Hi,

I’m not sure, but i’d say it doesn’t have anything to do with the include_path. The error message says.

Warningsimplexml_load_string() [function.simplexml-load-string]Entityline 1parser error XML declaration allowed only at the start of the document  in C:\xampp\htdocs\magento\lib\Varien\Simplexml\Config.php on line 494

It finds the file, but there’s a problem with it.

Let us know the result!

Cheers,

 
Magento Community Magento Community
Magento Community
Magento Community
 
oliverscarlett
Jr. Member
 
Total Posts:  15
Joined:  2008-04-10
 

Thanks, Adam and Gabriel.

Are you aware of a debugging tool that could shed more light on the error? Firefox plugin or otherwise.

 
Magento Community Magento Community
Magento Community
Magento Community
 
alistek
Sr. Member
 
Total Posts:  293
Joined:  2008-04-02
Normal, IL
 

The main ones for Firefox are Firebug and the Web Developer’s Toolbar.  I don’t know how much good that will do there because it is not really for debugging php code just the html/css/ajax calls.

-Adam

 
Magento Community Magento Community
Magento Community
Magento Community
 
Gabriel Queiroz
Sr. Member
 
Total Posts:  135
Joined:  2008-05-28
Brasília, Brazil
 

Take a look at these:

http://www.zend.com/en/community/pdt
http://www.xdebug.org/

Both require server side installation, though.

Cheers,

 
Magento Community Magento Community
Magento Community
Magento Community
 
oliverscarlett
Jr. Member
 
Total Posts:  15
Joined:  2008-04-10
 

Gabriel and Adam thank you!

It was the leading spaces - don’t I feel like the biggest idiot!

Thanks again.

 
Magento Community Magento Community
Magento Community
Magento Community
 
alistek
Sr. Member
 
Total Posts:  293
Joined:  2008-04-02
Normal, IL
 

Glad you figured it out!

-Adam

 
Magento Community Magento Community
Magento Community
Magento Community
 
Gabriel Queiroz
Sr. Member
 
Total Posts:  135
Joined:  2008-05-28
Brasília, Brazil
 

Super! =)

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top