configure: error: Please reinstall the libzip distribution - php

I am getting this error, when trying to install Zip for PHP 7:
pecl install zip
yields the error
configure: error: Please reinstall the libzip distribution
I did not find anything related to this error.
I tried apt-get install libzip but the package was not found.

Solved it:
apt-get install libzip-dev
will install the missing libzip-distribution

This might be helpful for webmin/virtualmin users running CentOS 7:
yum install php-pecl-zip
This worked for me.

This worked for me with Amazon Linux:
yum install libzip-devel.x86_64

At the time of this writing, I had to use libzip > = 0.11. The libzip/libzip-devel package on the official
CentOS x86_64 repository is still on 0.10. To get around this, the Psychotic Ninja Plus x86_64 repository offers a 0.11 version. Information for libzip and libzip-devel on the Psychotic Ninja Plus repositories can be found on those links.
To install and use this version, you can run the following commands,
Download latest psychotic-release rpm from
http://packages.psychotic.ninja/7/plus/x86_64/RPMS/
Install psychotic-release rpm:
rpm -Uvh psychotic-release*rpm
Install libzip-devel rpm package:
yum --enablerepo=psychotic-plus install libzip-devel

Since it took me some time and research to figure this out i think it may come handy for mac-users:
You can install libzip through brew using:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
And then:
brew install libzip

Related

conflicting requests install php-zip on fedora

I'm trying to install php-zip but I get a conflict error:
Problem: conflicting requests
- nothing provides libzip(x86-64) >= 1.8.0 needed by php-pecl-zip-1.19.5-1.fc34.remi.8.0.x86_64
- nothing provides libzip(x86-64) >= 1.8.0 needed by php-pecl-zip-1.20.0-1.fc34.remi.8.0.x86_64
This library is available in "remi" repository, which seems to not be enabled.
https://rpms.remirepo.net/fedora/34/remi/x86_64/repoview/libzip.html
No need pear package, just use the below command.
sometime need check os version then use compatible repo
$ dnf install libzip-dev libzip php-zip php-devel -y
$ php -m | grep zip
> zip

Can't upgrade SSH2 with pecl

My current version of pecl SSH2 is 0.12 and I am trying to upgrade it to 0.13.
I tried both:
pecl upgrade ssh2-0.13
and
pecl install ssh2-0.13
and got
ERROR: pecl.php.net/ssh2 not installed
Not much feedback, what else can I try?
using php 5.6 and PEAR 1.9.5
I am using CentOS and following helped me to upgrade, might help you too
yum install gcc php-devel php-pear libssh2 libssh2-devel
// or in ubuntu(deb) sudo apt-get install ...............
pecl install -f ssh2
Actually i removed my old version and did above. And i installed all the packages that require. Please make sure you have installed all the required packages (gcc, php-devel, php-pear, libssh2, libssh2-devel) and then try to install or upgrade again.

Error install pecl/raphf and propro

I have updated php5.5 to php7.0.
I try to run this commande :
pecl install pecl/raphf
But I obtain this error :
Parse error: syntax error, unexpected 'new' (T_NEW) in /usr/share/php/PEAR/Frontend.php on line 91
How I can install :
pecl install pecl/raphf
pecl install pecl/propro
Try update PEAR:
$ wget http://pear.php.net/go-pear.phar
$ php go-pear.phar
Original Answer in GitHub Issue
I solving my problem :
I have unistalled php 7.0.5, and installed php 5 for get old pear version.
apt-get install php-pear
pear clear-cache
pear upgrade pear-1.10.0
Then, I am re-installed php7.0.5
It work !
Pear 1.10.0 supports php7. Upgrade your pear.
http://pear.php.net/package/PEAR/download/1.10.0
I solved my similar problem on Centos7.x for root user:
I'm remove default package:
yum remove php-pear
Next i'm install package for php7.x (for example php7.1) and default package:
yum -y install php71-php-pear && yum -y install php-pear
After install i'm find my php71-pear directory and create symlink instead of default php-pear:
find / -type d -name 'pear'
...
/opt/remi/php71/root/usr/share/doc/pear
/opt/remi/php71/root/usr/share/pear
/opt/remi/php71/root/usr/share/tests/pear
...
mv /usr/share/pear /usr/share/pear_5
ln -s /opt/remi/php71/root/usr/share/pear /usr/share/pear
Profit...
pecl -V
PEAR Version: 1.10.7
PHP Version: 7.1.5
Zend Engine Version: 3.1.0
You don't need uninstall PHP 7. You can edit /usr/bin/pear and set php=/usr/bin/php5. Then update PEAR.
I have install both php env like php5.6 and php7.1
Try update PEAR:
$ wget http://pear.php.net/go-pear.phar
$ php go-pear.phar

RuntimeException The Zip PHP extension is not installed

I'm a newbie in Linux I just installed composer and laravel...
but when i run the laravel new project i get the following error:
[RuntimeException]
The Zip PHP extension is not installed. Please install it and try again.
I don't know how to install that extension...
please help
Try type into the command line:
sudo apt-get install php7.0-zip
Verify from any route with:
dd(get_loaded_extensions());
This worked for me, good luck.
for php 7.0
sudo apt-get install php7.0-zip
for php 7.1
sudo apt-get install php7.1-zip
and so on!
I got the same issue and tried to install the extension with the command sudo apt install php7.0-zip but still got the same error. I finally solved it with sudo apt install php-zip
I was using php7.0-zts.The solution was to uninstall all the ZTS packages and revert to the regular php7.0 packages.
use this sudo apt-get install php-zip
The php version will be sorted out by the system.
This is outdate using brew doctor and brew cleanup. Brew doctor will give you some fixes that will help you install laravel.
composer global require laravel/installer\n && brew install php
installing on CentOS
try yum search zip |grep -i php and install with package name came back
like - sudo yum install ea-php73-php-zip.x86_64
You can use php-zip or php-zip7.x package from apt. Such as:
sudo apt-get install php-zip
Many packages in apt have a default version such as php-zip then explicit version(s). In order to search apt for packages you can always use
apt-cache search keyword
Or in this example specifically either
apt-cache search zip
apt-cache search php-zip
Which will allow you to find the php-zip and php-zip7.4 (at the time of writing this comment) package to install.
Very useful command to when you're trying to satisfy some dependency and cannot find the package name.

struggling to install PHP pecl on Centos

I'm trying to install the php_http PHP extension on my CentOS server.
I have done:
yum install php-pear
But get:
No package php-pear available
Yet I can do:
pear
And get a list of commands from Pear.
Same for yum install pecl. I can do pecl but pecl install pecl_http returns:
No releases available for package "pecl.php.net/pecl_http"
install failed
Yet /usr/bin/pecl isn't a directory that exists. Also a sudo pecl install pecl_http returns sudo: pecl: command not found, which I find quite odd.
I'm not entirely sure what's going on here/what I'm doing wrong.
edit: I am using the following repos:
base CentOS-6 - Base
epel Extra Packages for Enterprise Linux 6 - x86_64
extras CentOS-6 - Extras
rpmforge RHEL 6 - RPMforge.net - dag
updates CentOS-6 - Updates
vz-base vz-base
vz-updates vz-updates
On CentOS,
Install PHP Pear if not installed yet:
# yum install php-pear
Install GCC if not installed yet:
# yum install gcc
Install cURL if not installed yet:
# yum install curl-devel
Install following libraries if not installed yet:
# yum install php-devel
# yum install zlib-devel
# yum install pcre-devel
Start the main installation:
# pecl install pecl_http
Add the following line to /etc/php.ini file
extension=raphf.so
extension=propro.so
extension=http.so
Restart apache server so the extension can be loaded
# service httpd restart
You can check if it installed successfully or not:
# pecl list
Step 1) import the REMI repo
CentOS 5
rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm;
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm;
CentOS 6
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm;
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm;
Step 2) install php-pear
yum --enablerepo=remi,remi-php55 install php-pear
Step 3) install pecl_http
pecl install pecl_http
For other people having this problem. I discovered this question while trying to figure out why I was having the same problem. Turned out the default configuration at my hosting provider was to include php* in the exclude directive for yum. Check /etc/yum.conf and make sure that the package you're trying to install isn't matched by an entry in the exclude directive.
if you are running php 7 you might want to try this
yum install php70w-pear
if you get any errors, be sure to uninstall the pear package from any previous attempts
yum remove php-pear
best of luck
If you are using php 5.4.x, IMO best repo to use is iuscommunity. Its very stable and used by Rackspace to do only PHP and a few other packages for CentOS.
rpm -Uhv http://dl.iuscommunity.org/pub/ius/stable/CentOS/6/x86_64/ius-release-1.0-11.ius.centos6.noarch.rpm
yum install php54-pear
Mind you, the reason why its php54-pear and not php-pear is because 5.3 and 5.4 both are compiled in the repository. Here is the list of php packages -> http://dl.iuscommunity.org/pub/ius/stable/CentOS/6/x86_64/repoview/development.languages.group.html
I tested this and it works, but I only use EPEL and iuscommunity REPO's. I avoid using rpmforge myself.
Centos 6.5 and php7:
sudo su -
yum install yum-utils
you can get last version of lua : http://pecl.php.net/package/lua
wget http://pecl.php.net/get/lua-2.0.4.tgz
tar -xvzf lua-2.0.4.tgz
cd lua-2.0.4
mkdir /usr/include/lua
mv * /usr/include/lua
yum install gcc
yum install php70w-pearl php70w-devel
yum install curl-devel
yum install zlib-devel
yum install pcre-devel
ln -s /usr/include/lua.h /usr/include/lua/lua.h
rpm -Uvh https://centos6.iuscommunity.org/ius-release.rpm
yum-config-manager --enable remi-php70
yum update
yum --enablerepo=remi,remi-php70 install php70w-pear
yum install lua-devel lua-static
pecl install lua-2.0.4
Whatever your PHP provider is (IUS, Remi or Webtatic), the pear package and the pecl extensions "should" be available there, without any need to compile it from sources (which is usually discouraged, especially on production)
At least "remi" provides most extensions, see the list
So installation should be as simple as
yum install php-pecl-http
yum install php-pecl-lua
etc
And, don't forget to read the Wizard instructions
I tried almost everything on this list before I finally realized that my WHM/cPanel installation was blocking the yum packages. I have to install all PECL modules (I was stuck trying to install mongodb on this particular occation) through the Home > Software > Module Installers inside WHM (cpanel documentation says that you have to be logged in as root).
After watching a lot of threads and installing pear and all the devtool, I finally solved it installing this extension:
yum install php-pecl-mongo
as I seen in - https://madcoda.com/2012/12/install-mongodb-php-driver-in-centos-6-3/

Categories