Can’t Install PHP 7 Support Patch in Magento 1.9 – Fix Guide

magento-1.9patchesphp-7

I downloaded the official php7 support patch PATCH-1.9.3.0_PHP7-2018-09-13-07-59-59.2_v2 from here.

I noticed that the file is downloaded without any extension, so I renamed it from PATCH-1.9.3.1-1.9.3.9_PHP7-2018-09-13-08-01-43.2_v2 to PATCH-1.9.3.1-1.9.3.9_PHP7-2018-09-13-08-01-43.2_v2.sh.

Then I executed the patch sh PATCH-1.9.3.1-1.9.3.9_PHP7-2018-09-13-08-01-43.2_v2.sh.
But this is what I get:

diff: unrecognized option '--git'
diff: Try 'diff --help' for more information.
PATCH-1.9.3.1-1.9.3.9_PHP7-2018-09-13-08-01-43.2_v2.sh: line 2: index: command not found
PATCH-1.9.3.1-1.9.3.9_PHP7-2018-09-13-08-01-43.2_v2.sh: line 3: ---: command not found
PATCH-1.9.3.1-1.9.3.9_PHP7-2018-09-13-08-01-43.2_v2.sh: line 4: +++: command not found
PATCH-1.9.3.1-1.9.3.9_PHP7-2018-09-13-08-01-43.2_v2.sh: line 5: syntax error near unexpected token `('
PATCH-1.9.3.1-1.9.3.9_PHP7-2018-09-13-08-01-43.2_v2.sh: 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.


UPDATE

I tried it like this: git apply PATCH-1.9.3.1-1.9.3.9_PHP7-2018-09-13-08-01-43.2_v2

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.

Best Answer

patch -p1 < PATCH-1.9.3.0_PHP7-2018-09-13-07-59-59.2_v2

Related Topic