I downloaded the official php7 support patch PATCH- from here.

I noticed that the file is downloaded without any extension, so I renamed it from PATCH- to PATCH-

Then I executed the patch sh PATCH- But this is what I get:

diff: unrecognized option '--git'
diff: Try 'diff --help' for more information.
PATCH- line 2: index: command not found
PATCH- line 3: ---: command not found
PATCH- line 4: +++: command not found
PATCH- line 5: syntax error near unexpected token `('
PATCH- line 5: `@@ -53,6 +53,9 @@ if (defined('COMPILER_INCLUDE_PATH')) {'

Tested on a fresh Magento V1.9.3.10. Do we have to patch the patch?

I installed another patch which also has the same diff --git command and that worked, but this patch wont work.


I tried it like this: git apply PATCH-

Im not sure if it worked because there was no output.

Note: You can install these patches using either patch or git apply . See the Instructions section of the Magento 1 Official PHP 7.2 patches blog post for more information on both forms of installation.

Info found here.


2 Answers 2


patch -p1 < PATCH-

  • According to Magento Team, this command is only for files with the extension "patch". But it worked.
    – Black
    Oct 19, 2018 at 7:39

To patch with GIT:

$ git apply --apply PATCH-

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.