Can't install laravel installer via composer
Solution 1
It says that it requires zip extension
laravel/installer v1.4.0 requires ext-zip...
Install using (to install the default version):
sudo apt install php-zip
Or, if you're running a specific version of PHP:
# For php v7.0
sudo apt-get install php7.0-zip
# For php v7.1
sudo apt-get install php7.1-zip
# For php v7.2
sudo apt-get install php7.2-zip
# For php v7.3
sudo apt-get install php7.3-zip
# For php v7.4
sudo apt-get install php7.4-zip
Solution 2
FOR MAC USERS with CATALINA
First, install homebrew. Then, say
brew install [email protected]
brew link [email protected]
restart the console and run the laravel installer
Solution 3
On centos 7 I have used:
yum install php-pecl-zip
because any other solution didn't work for me.
Solution 4
For PHP7.1 install this
sudo apt-get install php7.1-zip
Solution 5
If you're facing this issue with macOS Catalina, I recommend these steps:
Install Homebrew (if you haven't already done so): head over to brew.sh or simply run this command:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Run
brew install [email protected]
Update your $PATH variable to include the newly installed version of php:
echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.zshrc
echo 'export PATH="/usr/local/opt/[email protected]/sbin:$PATH"' >> ~/.zshrc
Reload your shell preferences script
$ source ~/.zshrc
orsource ~/.bashrc
Finally, install laravel:
composer global require laravel/installer
Andreas Sauer
Updated on August 04, 2020Comments
-
Andreas Sauer almost 4 years
I'm trying to install laravel installer with the composer on my Ubuntu PC, but I get this error during the installation. `Your requirements could not be resolved to an installable set of packages.
Problem 1 - laravel/installer v1.4.1 requires ext-zip * -> the requested PHP extension zip is missing from your system. - laravel/installer v1.4.0 requires ext-zip * -> the requested PHP extension zip is missing from your system. - Installation request for laravel/installer ^1.4 -> satisfiable by laravel/installer[v1.4.0, v1.4.1]. To enable extensions, verify that they are enabled in those .ini files: - /etc/php/7.0/cli/php.ini - /etc/php/7.0/cli/conf.d/10-opcache.ini - /etc/php/7.0/cli/conf.d/10-pdo.ini - /etc/php/7.0/cli/conf.d/20-calendar.ini - /etc/php/7.0/cli/conf.d/20-ctype.ini - /etc/php/7.0/cli/conf.d/20-exif.ini - /etc/php/7.0/cli/conf.d/20-fileinfo.ini - /etc/php/7.0/cli/conf.d/20-ftp.ini - /etc/php/7.0/cli/conf.d/20-gettext.ini - /etc/php/7.0/cli/conf.d/20-iconv.ini - /etc/php/7.0/cli/conf.d/20-json.ini - /etc/php/7.0/cli/conf.d/20-phar.ini - /etc/php/7.0/cli/conf.d/20-posix.ini - /etc/php/7.0/cli/conf.d/20-readline.ini - /etc/php/7.0/cli/conf.d/20-shmop.ini - /etc/php/7.0/cli/conf.d/20-sockets.ini - /etc/php/7.0/cli/conf.d/20-sysvmsg.ini - /etc/php/7.0/cli/conf.d/20-sysvsem.ini - /etc/php/7.0/cli/conf.d/20-sysvshm.ini - /etc/php/7.0/cli/conf.d/20-tokenizer.ini You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode. `
The error appears then I use this comment:
composer global require "laravel/installer"
-
Tyler Christian about 6 yearsWorks perfectly but shouldn't this be in the composer install? It's a dependency manager...missing a dependency. Maybe it was Cannonical that missed the inclusion.
-
Alex about 6 years@TylerChristian, composer install manages PHP dependencies, php7.0-zip is a system package. It can't be solved by composer. Theoretically, it's possible to add hook that installs system package as well, but it will require sudo access, which is REALLY bad practice.
-
Henry almost 6 years
requires ext-zip
is a pretty unhelpful message. Should sayrequires php-zip or phpX.X-zip
at least. -
Eric Hauenstein almost 5 yearsPlease add some comments to explain how your code answers the question in order to improve this answer.
-
mehmetakkus almost 5 yearsI'm getting this error E: Unable to locate package php7.3-zip E: Couldn't find any package by glob 'php7.3-zip' E: Couldn't find any package by regex 'php7.3-zip'
-
user1771561 over 4 yearsBefore step 4, open a new terminal window, else the new $PATH will not be available.
-
Martijn Pieters about 4 yearsThe question asks about Ubuntu, not CentOS.
-
Martijn Pieters about 4 yearsThe question asks about Ubuntu, not CentOS.
-
Martijn Pieters about 4 yearsThe question asks about Ubuntu, not Mac.
-
Martijn Pieters about 4 yearsThe question asks about Ubuntu, not Mac.
-
Martijn Pieters about 4 yearsThe question asks about Ubuntu, not Mac.
-
Hosny Ben about 4 yearsfor mac os users please user Homebrew instead. You don't need to run brew commands as root. example : brew install php7.0-zip
-
GTS Joe about 4 yearsThis is exactly what I was looking for, thanks. yum install php-zip doesn't work on CentOS 7.
-
Nico Haase almost 4 yearsPlease add some further explanation to your answer - how does this list of commands resolve the given problem?
-
Nico Haase almost 4 yearsPlease add some further explanation to your answer - how does this command resolve the given problem? Is there any problem in simply installing the given extension without installing other programs first?
-
Jaydip Kalkani almost 4 yearsaddition,
brew link [email protected]
didn't work. It gave me a warning. I needed to force it usingbrew link [email protected] --force
. -
danielricecodes almost 4 yearsBut I got here looking for this error and I'm on OS X Catalina. This answer is helpful.
-
Art Williams over 3 yearsfor specific versions of php use one of the following package names after "yum install":
php54-php-pecl-zip php55-php-pecl-zip php56-php-pecl-zip php70-php-pecl-zip php71-php-pecl-zip php72-php-pecl-zip php73-php-pecl-zip php74-php-pecl-zip php80-php-pecl-zip