The patch is a package of core/vendor files modified to deliver bug fixes & other security-related bugs that cause security vulnerabilities.
Applying up-to-date patches with Magento releases will ensure that your online store is secure.
Today we will discuss some of the different methods to apply patches in Magento 2.
Apply Patch in Community Edition
In community addition, you can download the .patch file and place it in the root directory of your Magento installation.
Once the patch file has been added to the server, you can apply it using the git patch command shown below.
1 |
git apply your-patch-file.patch |
Alternatively, you can apply the patch using the following command.
1 |
patch -p1 < your-patch-file.patch |
Apply Patch in Magento Cloud Edition
To apply the patch on Magento Cloud, simply add it to your m2-hotfixes folder.
The patch will be automatically applied runtime on the deployment.
During deployment, the patch will be automatically applied.
If you are working in the local environment, you can use ece-patches to apply patches in your environment.
Run the below command to apply all security patches and custom patches that are placed inside the m2-hotfixes folder.
1 |
php vendor/bin/ece-patches apply |
Quality Patch Tool
We can find patches that are officially released by the Adobe team for open source and cloud in below list.
https://experienceleague.adobe.com/tools/commerce-quality-patches/index.html
That’s it for today’s tutorial. See you in the next blog.
Happy Coding 🙂
You may also like,
Comments
Nice blog useful
Author
Thank You Avinash !