I updated a extension in a working magento (running on localhost), after updating it stopped working, so I got back with git and restored the database.

After going to the previous version and restoring the database I got the following error:

Warning: simplexml_load_string(): Entity: line 18: parser error : Premature end of data in tag config line 17  in /Applications/MAMP/htdocs/magento/lib/Varien/Simplexml/Config.php on line 510

#0 [internal function]: mageCoreErrorHandler(2, 'simplexml_load_...', '/Applications/M...', 511, Array)
#1 /Applications/MAMP/htdocs/magento/lib/Varien/Simplexml/Config.php(511): simplexml_load_string('loadString('loadFile('/Applications/M...')
#4 /Applications/MAMP/htdocs/magento/app/code/core/Mage/Core/Model/Config.php(318): Mage_Core_Model_Config->loadModulesConfiguration(Array, Object(Mage_Core_Model_Config))
#5 /Applications/MAMP/htdocs/magento/app/code/core/Mage/Core/Model/App.php(414): Mage_Core_Model_Config->loadModules()
#6 /Applications/MAMP/htdocs/magento/app/code/core/Mage/Core/Model/App.php(343): Mage_Core_Model_App->_initModules()
#7 /Applications/MAMP/htdocs/magento/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#8 /Applications/MAMP/htdocs/magento/index.php(87): Mage::run('', 'store')
#9 {main}

So I added some debug in lib/Varien/Simplexml/Config.php

public function loadString($string)
    if (is_string($string)) {
        $xml = simplexml_load_string($string, $this->_elementClass);
            Mage::log('XML_ELEMENTCLASS: '.$this->_elementClass);
            Mage::log('XML_ERROR: ' . $string);
        if ($xml instanceof Varien_Simplexml_Element) {
            $this->_xml = $xml;
            return true;
    } else {
        Mage::logException(new Exception('"$string" parameter for simplexml_load_string is not a string'));
    return false;

and also a Mage::log('XML_FILE: ' . $filePath); in the loadFile($filePath) function on line 489.

Now I get the following log:

2018-05-07T13:07:30+00:00 DEBUG (7): XML_FILE: /Applications/MAMP/htdocs/magento/app/etc/config.xml
2018-05-07T13:07:30+00:00 DEBUG (7): XML_FILE: /Applications/MAMP/htdocs/magento/app/etc/local.xml
2018-05-07T13:07:30+00:00 DEBUG (7): XML_ELEMENTCLASS: Mage_Core_Model_Config_Element
2018-05-07T13:07:30+00:00 DEBUG (7): XML_ERROR: <config/>
2018-05-07T13:07:30+00:00 DEBUG (7): XML_FILE: /Applications/MAMP/htdocs/magento/app/etc/modules/Mage_All.xml
2018-05-07T13:07:30+00:00 DEBUG (7): XML_FILE: /Applications/MAMP/htdocs/magento/app/etc/modules/Mage_Api.xml
// the list is too long and I think the problem is in the beginnning so I cut it here

This log makes me think that the error is on app/etc/local.xml the last file before the error, and a file in the gitignore. I checked this xml file in a online xml validator and it is ok. I also checked app/etc/config.xml, and it is ok too.

So I tried to delete app/etc/local.xml and reinstall magento, but this leads me to a ERR_TOO_MANY_REDIRECTS

As a last resource I copied the config.xml and local.xml from other working projects, even the same working project in test changing the fields crypt.key, connection.host, connection.username, connection.password, connection.dbname but exactly same result.

At this point I don't know what else I should look or change to make the project run again.

  • Maybe this helps to debug: magento.stackexchange.com/questions/179905/… – sv3n May 7 '18 at 14:05
  • Thanks to this I found an error in a module xml config file, but this error was present when the project was working on localhost, on test and on production (it keeps working in test and production with this error). I corrected this error and now I see same XML_ERROR error on log file, but in the browser I get a 'The server encountered an internal error or misconfiguration and was unable to complete your request.' And in the apache error log I get a [Mon May 07 2018] [error] [client ::1] FastCGI: incomplete headers (0 bytes) received from server "/Applications/MAMP/fcgi-bin/php5.6.32.fcgi" – Alex May 7 '18 at 14:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.