概述

在Centos7 arm环境中编译安装PHP7.4时报错:

In file included from /usr/local/php7/src/php-7.4.22/Zend/zend.h:356:0,
                 from /usr/local/php7/src/php-7.4.22/main/php.h:33,
                 from /usr/local/php7/src/php-7.4.22/ext/standard/array.c:24:
/usr/local/php7/src/php-7.4.22/ext/standard/array.c: In function 'zif_array_sum':
/usr/local/php7/src/php-7.4.22/Zend/zend_operators.h:674:2: error: invalid 'asm': invalid operand prefix '%c'

解决办法

修改Zend/zend_operators.h文件中ZEND_USE_ASM_ARITHMETIC 值均为0即可。

#if defined(HAVE_ASM_GOTO) && !__has_feature(memory_sanitizer)
# define ZEND_USE_ASM_ARITHMETIC 1
#else
# define ZEND_USE_ASM_ARITHMETIC 0
#endif

分类: PHP