I'm trying to install zipArchive with pecl. After running the command, I get an error - "Please reinstall the libzip distribution".
I'm running PHP 7.2 on Amazon Linux 2.
Here's my output:
$ ./pecl install zip
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading zip-1.15.2.tgz ...
Starting to download zip-1.15.2.tgz (249,280 bytes)
....................................................done: 249,280 bytes
8 source files, building
running: phpize
Configuring for:
PHP Api Version: 20170718
Zend Module Api No: 20170718
Zend Extension Api No: 320170718
building in /tmp/pear/install/pear-build-ec2-userIZcX1f/zip-1.15.2
running: /tmp/pear/install/zip/configure --with-php-config=/usr/bin/php-config
checking for grep that handles long lines and -e... /usr/bin/grep
...<snip up to warning>...
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... gawk
checking for zip archive read/writesupport... yes, shared
checking libzip... yes
checking PHP version... PHP 7.x
checking for pkg-config... /usr/bin/pkg-config
checking for libzip... not found
configure: error: Please reinstall the libzip distribution
ERROR: `/tmp/pear/install/zip/configure --with-php-config=/usr/bin/php-config' failed
But if I check libzip it's already installed:
$ sudo yum install libzip
Loaded plugins: langpacks, priorities, update-motd
amzn2-core | 2.0 kB 00:00:00
Package libzip-0.10.1-8.amzn2.x86_64 already installed and latest version
Nothing to do
I'm using ./pecl as I had to install a new version of pear from my home directory and the old version is still in the path. This is the command I used to get the updated version of pear.
$ wget http://pear.php.net/go-pear.phar
$ php go-pear.phar
I don't know if that makes any difference? I do have the correct version referred to in my php.ini:
;***** Added by go-pear
include_path=".:/home/ec2-user/pear/share/pear"
;*****
Any help appreciated.