1
votes

I'm trying to install Laravel using composer command, which I already successfully installed. Then, when I input $ composer global require "laravel/installer", I get the error message below that I don't understand.

Details: MacBook Pro(Version: 10.15.3) using Xampp

Thank you!

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - laravel/installer v3.0.1 requires ext-zip * -> the requested PHP extension zip is missing from your system.
    - laravel/installer v3.0.0 requires ext-zip * -> the requested PHP extension zip is missing from your system.
    - Installation request for laravel/installer ^3.0 -> satisfiable by laravel/installer[v3.0.0, v3.0.1].


Installation failed, deleting ./composer.json.
2
The error message is literally telling you what's wrong: requires ext-zip * -> the requested PHP extension zip is missing from your system - You need to install and enable PHP's zip-extensionM. Eriksson

2 Answers

1
votes

It says that it requires zip extension

brew update
brew install php@7.3
brew link php@7.3

It will install PHP 7.3.10 with the zip module. You can use PHP -v to check for the version, and PHP -m for the modules to check.

With respect to your errors Please do the following.

Add below to your ~/.bash_profile file:

export PATH="/usr/local/opt/php@7.3/bin:$PATH"
export PATH="/usr/local/opt/php@7.3/sbin:$PATH"

OR try adding the following in ~/.bashrc file

export PATH="/usr/local/opt/php@7.3/bin:$PATH"
export PATH="/usr/local/opt/php@7.3/sbin:$PATH"
1
votes

This issue is already mentioned in the Laravel github repository here

As mentioned in the article. You can resolve this using below commands

brew install php@7.3
brew link php@7.3 --force
echo 'export PATH="/usr/local/opt/php@7.3/bin:$PATH"' >> ~/.bashrc 
echo 'export PATH="/usr/local/opt/php@7.3/sbin:$PATH"' >> ~/.bashrc