I am using Magento and when I checked in magereport.com, It is showing that I need to apply below patches in my Magento.

Patches: SUPEE- 5994, SUPEE - 6285(XSS,RSS), SUPEE - 6482, SUPEE - 6788, SUPEE - 7405, SUPEE -8788.

When I applied these patches by downloading there files from command line then some of them are not applied and because of that some magento functionality stoped working.

Can anyone tell me what is the Best way to apply these patches in Magento ?

3 Answers 3


You need SSH (shell) access to download and apply the patch. You need only three commands, CD, WGET and BASH, to navigate, download and apply the patch.

Step 1: Make a backup

There’s a chance that certain plugins or elements in your webshop aren’t compatible with the Magento patch. That’s why we always recommend you to make a backup first, in case something goes wrong.

Step 2: Log on to SSH (shell)

Log on to the shell server. If you don’t how to log on, contact your hosting provider or technical contact

Step 3: Download the patch

To download the correct patch for your webshop you need to know what version of Magento your using, here you need .

Download the patch(es) you need via the Magento downloads page.

Step 4: Apply the patch

The command BASH will apply the patch you just downloaded:


Let’s assume here that the patch name is: patch_supee-5994.sh . Your actual command would look like this:

bash patch_supee-5994.sh

Step 5: Clear your cache

It’s important to flush the Magento cache after applying the patch. Flushing your caches can be done in the back-end of your Magento shop under Cache management. Don’t forget to flush your OPcode or APC cache as well!

Step 6: Check your shop

Don’t forget to check your shop for vulnerabilities after patching and flushing your caches. Magento’s Security Patch Page provides a list of signs to look out for to determine whether your site is comprised or not.

  • when i ran bash SUPEE-5994.sh , it is throwing ERROR : Hunk file app/code/core/Mage/Adminhtml/Controller/Action.php and patch is also not applied. What to do next ???
    – BornCoder
    Commented Jan 31, 2017 at 17:26
  • Here, i dont know, sorry
    – PЯINCƎ
    Commented Jan 31, 2017 at 17:54

I think this is because the files has been modified. So when i get the error "ERROR : Hunk file app/code/core/Mage/Adminhtml/Controller/Action.php", what i do is:

  1. Check my version of Magento 1;
  2. Go to "https://github.com/OpenMage/magento-mirror"
  3. Download the exact file in the error;
  4. Replace the file in my project;
  5. run the command again (sh patch_xxx.sh);

And so on with all the files.


If you are using Linux, go to project directory and use


Start patching from the lowest one. Do one by one. Have attention for changing in code. Some SUPEE may cause some errors in custom modules.

Also good idea is make commits after each SUPEE installed.

  • but when i am applied SUPEE - 6285 patch using sh , it is throwing HUNK error . Can you tell me why and how to resolve that ?
    – BornCoder
    Commented Jan 31, 2017 at 12:27
  • Ah. It is error for specific number / lines in script? You can easly fix it by removing specific sections in script. In my case it was mostly changes for htaccess files and index probably. Commented Jan 31, 2017 at 12:32
  • yes, it showing for some specific lines. For me, this error coming mostly for core controller files like app/code/core/Mage/Adminhtml/Controller/Action.php. So what to do in this case ?
    – BornCoder
    Commented Jan 31, 2017 at 12:37
  • have someone change something in core app/code/core/Mage/Adminhtml/Controller/Action.php file? Commented Jan 31, 2017 at 12:40
  • No, i have not changed anything in core but this error is coming while applying these patches.
    – BornCoder
    Commented Jan 31, 2017 at 12:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.