Magento Errors

This was a pre-Xmas break frustration! When patching Magento sites with the SUPEE-10415 patch, if PHP warnings are present on the installation, then 404 errors are returned – locking you out of both frontend and backend.

So if you get as far as applying the patch without checking for PHP warnings (within var/log/system.log), then you should first of all revert the patch.

As you’ll probably know there are loads of reasons why you are getting PHP warnings in Magento, but the most common reason is an issue with one of your extensions config.xml files. You can check the validity of any of your XML files by running the following command within your app/ directory. (ref creative media)

find . -name "*.xml" -type f -exec xmllint --noout '{}' \;

In my case all of the config.xml files were fine, and a final manual check of all extensions confirmed this.

It’s useful to mention at this point that there’s another indicator as to the source of the warnings. If the PHP warnings are only present when Magento caching is enabled, then your XML files are not the culprit.

So what is? In my case, it was data within the core_config_data database table. This data is converted and run as XML similar to the config.xml files. These are run when caching is enabled (hence why there are no PHP warnings when Magento caching is disabled).

To fix, I searched the table for entries with terms related the warnings in the logs. I deleted the entries (warning: be aware you know what you’re deleting as Magento options are wiped and may need re-configuring) and re-saved any System/Configuration options which were wiped. The troublesome entries for me were extension licence data and a couple of other extension options. The entries had issues within them such as weird characters or names of incorrect functions.

After reading up on the possible causes, this troublesome data could have been created by spikes in traffic leading to corruption. I think in the extension licence entries case… this was caused by changing the Magento Base URL from dev to live when deployed.

Once all PHP warnings are fixed, you’re good to run the patch. You’ll no longer get the 404 errors and Magento will be patched successfully.

Did this help? Are you having trouble applying SUPEE-10415? Have you experienced the same issues with the core_config_data database table? Be sure to leave a comment or get in touch.