所以显然有人忘记了 AWS 的 php-zip 扩展。amazon-linux-extras php7.4 存储库中没有可用于 Amazon Linux 2 的 php-zip 扩展。有人知道如何安装 php-zip 扩展吗?这是非常关键的,因为许多库都需要这个扩展。
我试过通过 Pecl 没有成功。看起来 Amazon Linux 2 上的底层软件包与 Pecl 安装方法不兼容。
/bin/sh /var/tmp/pear-build-defaultuserQfyCvq/zip-1.13.5/libtool --mode=compile cc -I. -I/var/tmp/zip -DPHP_ATOM_INC -I/var/tmp/pear-build-defaultuserQfyCvq/zip-1.13.5/include -I/var/tmp/pear-build-defaultuserQfyCvq/zip-1.13.5/main -I/var/tmp/zip -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/var/tmp/zip/lib -I/var/tmp/zip/php7 -DHAVE_CONFIG_H -g -O2 -c /var/tmp/zip/php7/php_zip.c -o php7/php_zip.lo
libtool: compile: cc -I. -I/var/tmp/zip -DPHP_ATOM_INC -I/var/tmp/pear-build-defaultuserQfyCvq/zip-1.13.5/include -I/var/tmp/pear-build-defaultuserQfyCvq/zip-1.13.5/main -I/var/tmp/zip -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/var/tmp/zip/lib -I/var/tmp/zip/php7 -DHAVE_CONFIG_H -g -O2 -c /var/tmp/zip/php7/php_zip.c -fPIC -DPIC -o php7/.libs/php_zip.o
/var/tmp/zip/php7/php_zip.c: In function 'php_zip_pcre'
更新: Pecl 方法的工作原理如下:
yum install php-devel* gcc libzip php-libzip libzip-devel zlip zip php-pear
pecl install zip
然而,这远非任何生产服务器的理想方法。仍在等待 AWS 将其作为预编译的二进制文件提供。