I’m running php7 on a redhat machine and am getting the following error in laravel:
Class 'ZipArchive' not found
I had this issue on my personal virtual machine server and all I had to do was run:
sudo yum install php7.0-zip
On my dev server I tried running the command and I get:
sudo yum install php7.0-zip
Loaded plugins: product-id, search-disabled-repos, subscription-manager
No package php7.0-zip available.
Just for more information here is my php version:
php -v
PHP 7.1.12 (cli) (built: Dec 1 2017 13:53:12) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
Edit: If I run php7.1-zip
sudo yum install php7.1-zip
Loaded plugins: product-id, search-disabled-repos, subscription-manager
epel/x86_64/metalink | 16 kB 00:00
gitlab_gitlab-ee/x86_64/signature | 836 B 00:00
gitlab_gitlab-ee/x86_64/signature | 1.0 kB 00:00 !!!
gitlab_gitlab-ee-source/signature | 836 B 00:00
gitlab_gitlab-ee-source/signature | 951 B 00:00 !!!
icinga-stable-release | 2.5 kB 00:00
jenkins | 2.9 kB 00:00
plesk-php-5.6 | 2.9 kB 00:00
plesk-php-7.0 | 2.9 kB 00:00
remi-php71 | 2.9 kB 00:00
remi-safe | 2.9 kB 00:00
(1/2): remi-php71/primary_db | 208 kB 00:00
(2/2): remi-safe/primary_db | 1.1 MB 00:01
No package php7.1-zip available.
Error: Nothing to do
5
Answers
Perhaps you can try to install php7.1-zip or php-zip packages…
As you are using some plesk package, this is not really a RHEL/CentOS server.
What is the package name providing the php command ?
same repository
need php71-php-pecl-zip from the same repository
General rule, for any foo extension yum install package_namespace-foo should work, as explained by the Wizard.
I had the same problem. I was getting:
when running
I first searched all yum packages by running:
if returns nothing then run :
if returned:
Then I installed the package that the search told me was there:
The installation worked like a charm. Then I restarted my apache server.
Now php zip (for php7) is installed!
I know is an old thread, but I faced same problem on CENTOS, and I solved similar (but quite different way):
No Matches found
found this
then
and it was successfully installed
after that I restarted apache
and problem was solved
I took me a lot of time, because I did not know package name, difficult for me, I found that on web: ea-php70-php-zip.x86_64
I had the same problem for PHP 7.1. I learned about
yum search
on the zip package:I installed it:
For some reason, the files
zip.so
andzip.ini
were missing in/usr/lib64/php/modules
and/etc/php.d/
directories respectively. So I copied them:Finally, I restarted the services
And I can see that
zip
is loaded: