B
B
big_hasan2016-12-07 12:59:39
CentOS
big_hasan, 2016-12-07 12:59:39

I can't create a Laravel project from under CentOs, it gives an error "The Zip PHP extension is not installed", why?

Raised a virtual machine from under Vagrant (CentOS 6), I'm trying to create a Laravel project. When I try to run the command:
$ laravel new blog
it gives the following:

[RuntimeException]
  The Zip PHP extension is not installed. Please install it and try again.


new [--dev] [--5.2] [--] [<name>]

I googled and suggested that there is a certain Zip extension for PHP missing. I tried to install the following:
$ sudo yum install php7.0-zip
which in the end also did not help and it turned out:
Loaded plugins: priorities
Setting up Install Process
base                                                       | 3.7 kB     00:00
centos-sclo-rh                                             | 2.9 kB     00:00
centos-sclo-sclo                                           | 2.9 kB     00:00
centosplus                                                 | 3.4 kB     00:00
elrepo                                                     | 2.9 kB     00:00
epel                                                       | 4.3 kB     00:00
extras                                                     | 3.4 kB     00:00
ius                                                        | 2.3 kB     00:00
mysql-connectors-community                                 | 2.5 kB     00:00
mysql-tools-community                                      | 2.5 kB     00:00
mysql57-community-dmr                                      | 2.5 kB     00:00
puppetlabs-pc1                                             | 2.5 kB     00:00
puppetlabs-pc1/primary_db                                  |  95 kB     00:00
remi                                                       | 2.9 kB     00:00
remi-php70                                                 | 2.9 kB     00:00
remi-php70/primary_db                                      | 153 kB     00:00
updates                                                    | 3.4 kB     00:00
updates/primary_db                                         | 3.7 MB     00:01
1156 packages excluded due to repository priority protections
No package php7.0-zip available.
Error: Nothing to do

Having little understanding of what I was doing, I installed the following almost at random:
yum install php70-php-pecl-zip
The installation was also successful, but nothing changed (The
issue was resolved, the team helped yum install php-zip
(thanks Eugene !)

Answer the question

In order to leave comments, you need to log in

3 answer(s)
B
big_hasan, 2016-12-07
@big_hasan

yum install php-zip

K
krypt3r, 2016-12-07
@krypt3r

I looked at this php70-php-pecl-zip. It looks like it is put in who knows where and the extension needs to be written by hand. Look for the zip.so lib (probably somewhere in /opt), throw it into the directory with php modules, add the extension so that php.ini sees it

A
Artem Bondarenko, 2016-12-07
@mr_avi

Try to see what there is in the turnips:

[email protected]:~$ sudo apt-cache search php | grep zip
[sudo] password for abonda: 
libphp-pclzip - zip archive manager class for PHP
php-zip - Zip module for PHP [default]
php7.0-bz2 - bzip2 module for PHP
php5.6-bz2 - bzip2 module for PHP
php-bz2 - bzip2 module for PHP [default]
php5.6-zip - Zip module for PHP
php7.0-zip - Zip module for PHP
php5.5-bz2 - bzip2 module for PHP
php5.5-zip - Zip module for PHP
php7.1-bz2 - bzip2 module for PHP
php7.1-zip - Zip module for PHP

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question