Magento site error: simplexml_load_file(): Entity: line 46: parser error

Started by Dipak Bhoi, January 05, 2015, 02:32:25 PM

Previous topic - Next topic

Dipak Bhoi

Hello Guys,

One of our client copied a Magento site under his another addon domain, he mapped all data and database but the site was redirecting to the magento install page and throwing an error as below:

Quote[05-Jan-2015 07:32:39 UTC] PHP Warning:  simplexml_load_file(): Entity: line 46: parser error : Opening and ending tag mismatch: password line 45 and dbname in /home/username/public_html/domain.com/app/Mage.php on line 767
[05-Jan-2015 07:32:39 UTC] PHP Warning:  simplexml_load_file():                     <dbname><![CDATA[database_name]]></dbname> in /home/sewingon/public_html/craftcouch.com/app/Mage.php on line 767
[05-Jan-2015 07:32:39 UTC] PHP Warning:  simplexml_load_file():                                                                ^ in /home/username/public_html/domain.com/app/Mage.php on line 767
[05-Jan-2015 07:32:39 UTC] PHP Notice:  Trying to get property of non-object in /home/username/public_html/domain.com/app/Mage.php on line 769

To resolve this error you need to read this error very carefully because an answer is hidden in this error.

As per a first line of error open file  /home/username/public_html/domain.com/app/Mage.php and to to line 767, but here you will not see any tag mismatch. You can see a code a below:

Quote$localConfig = simplexml_load_file($localConfigFile);

Now looks for a value $localConfigFile which mentioned above by 2-3 line of this line.

You can see a line as below:

Quote$localConfigFile = $etcDir . DS . 'local.xml';

As per the error there is a Opening and ending tag mismatch in file local.xml on line 45.

Now open the local.xml file (magento configuration file) and go to line 45.

#vi /home/username/public_html/domain.com/app/etc/local.xml

You can see code as below:

Quote<password><![CDATA[6GlJ0wnrzqdG]]></password>

Here check the opening and closing brackets [] should be same.

To resolve this error, I have corrected the opening an closing tag and website is working fine now. Hope this post will help you out.

Enjoy!!

Looking for quality Magento hosting? Look no further than MilesWeb Magento Hosting.
MilesWeb - 30-Day Money Back
cPanel Web Hosting - cPanel Hosting in India
Grab a Free SSL for your website.  WordPress Optimized Solution.