This one is always annoying because, short of using xdebug or other tracing up front, you won't know the file where this issue originated (or its path is often clipped in the trace output).
NOTE: Please ensure that you have taken the correct measures to configure your store for optimal debugging. See Fundamentals for debugging a Magento store for more information.
Method A
Try this. Temporarily, modify [SITE_ROOT]/lib/Varien/Simplexml/Config.php
:
public function loadFile($filePath)
{
if (!is_readable($filePath)) {
//throw new Exception('Can not read xml file '.$filePath);
return false;
}
$fileData = file_get_contents($filePath);
$fileData = $this->processFileData($fileData);
// Begin debugging
try {
return $this->loadString($fileData, $this->_elementClass);
} catch (Exception $error) {
echo $error->getMessage() . '<br/>' . $filePath;
exit;
}
// End debugging
}
Here you're trying to catch any exceptions, and print the file path before cutting off the process. So access your store again, and you should immediately see the source. If for some reason this method doesn't work, see below.
Once you identify the culprit file, open it in your IDE and fix the bad syntax. Then remove your logging from above and try again.
Method B
If you have access to the shell on your server and have the xmllint
tool installed on the system, run this awesome one-liner from MageInferno.
find app/code/local/ -type f -name "*.xml" -exec xmllint --noout {} \;
Where you must adjust app/code/local/
to point to the folder(s) you want to scan for XML errors. For example, if the cart2cart extension was installed in the community
code pool, then your path must be app/code/community
.