Day by day Magento 2 have been releasing their magento 2 patches to make it stable and more secure. Applying the Magento 2 Patches is being considered as tricky part and mostly developer are become confused while doing this, but its simple and required few steps to do as explain following.
Magento 2 has downloadable security patches, it can download from https://magento.com/tech-resources/download
Some of the patches are available in partner portal only, if you are Magento partner you can download the patches from there.
1) Using Git Environment
If you have git installed on your environment just use the following, copy the patch on you magento root folder and run the command below.
$ git apply MAGETWO-67805-2017-05-17-03-04-03.patch
2) Using PHP Script
- Download the patch file from magento official website.
- Upload it into the root folder of your magento store.
- Make one file with the name of patch.php in root directory, write following code in it.
<?php print("<PRE>"); passthru("/bin/bash CE-MAGETWO-67805.patch"); print("</PRE>"); echo "Done"; ?>
- The patch file name should be CE-MAGETWO-67805.patch.
- Run the file from the browser. You should receive success message screen once you run patch.php from the browser.
- Clear and flush the magento cache.