1

I am trying to install laravel on mac using terminal, but I am getting this error. I have php version 7.3 and the latest version of composer. How do I download the php exstensions using terminal on Mac.

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

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

  To enable extensions, verify that they are enabled in your .ini files:
    - /usr/local/php5/lib/php.ini
    - /usr/local/php5/php.d/10-extension_dir.ini
    - /usr/local/php5/php.d/20-extension-opcache.ini
    - /usr/local/php5/php.d/40-curl.ini
    - /usr/local/php5/php.d/40-openssl.ini
    - /usr/local/php5/php.d/50-extension-apcu.ini
    - /usr/local/php5/php.d/50-extension-curl.ini
    - /usr/local/php5/php.d/50-extension-gmp.ini
    - /usr/local/php5/php.d/50-extension-igbinary.ini
    - /usr/local/php5/php.d/50-extension-imap.ini
    - /usr/local/php5/php.d/50-extension-intl.ini
    - /usr/local/php5/php.d/50-extension-mcrypt.ini
    - /usr/local/php5/php.d/50-extension-mongodb.ini
    - /usr/local/php5/php.d/50-extension-mssql.ini
    - /usr/local/php5/php.d/50-extension-pdo_pgsql.ini
    - /usr/local/php5/php.d/50-extension-pgsql.ini
    - /usr/local/php5/php.d/50-extension-propro.ini
    - /usr/local/php5/php.d/50-extension-raphf.ini
    - /usr/local/php5/php.d/50-extension-readline.ini
    - /usr/local/php5/php.d/50-extension-redis.ini
    - /usr/local/php5/php.d/50-extension-xsl.ini
    - /usr/local/php5/php.d/99-liip-developer.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

Installation failed, reverting ./composer.json to its original content.
Yani
  • 11
  • 2
  • 5
  • Possible duplicate of [Can't install laravel installer via composer](https://stackoverflow.com/questions/46058457/cant-install-laravel-installer-via-composer) – rob006 Jul 15 '18 at 13:00
  • I have already tried the solution suggested in that post, but the mac terminal doesnt recognize the commands. – Yani Jul 15 '18 at 13:06
  • How did you install PHP 7 on your Mac? Should be done through brew. – Polaris Jul 15 '18 at 20:45

1 Answers1

5

Was recently experiencing the same issue. This is what fixed it for me:

  1. download PHP from brew (brew install php)
  2. make system use that version of PHP instead of the pre-installed PHP
  3. edit ~/.zshrc or ~/.bashrc to add the following:
export PATH="/usr/local/opt/php@7.3/bin:$PATH"
export PATH="/usr/local/opt/php@7.3/sbin:$PATH"

Then run

source ~/.zshrc
or
source ~/.bashrc

After I did that Laravel installed with no issues!

catcon
  • 1,295
  • 1
  • 9
  • 18
Corey J
  • 51
  • 1
  • 2