Can't install laravel installer via composer

前端 未结 14 2022
栀梦
栀梦 2020-11-27 13:04

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 inst

相关标签:
14条回答
  • 2020-11-27 13:20

    For PHP 7.2 in Ubuntu 18.04 LTS

    sudo apt-get install php7.2-zip
    

    Works like a charm

    0 讨论(0)
  • 2020-11-27 13:22

    For Mac with Macports,

    # port install php71-zip
    
    0 讨论(0)
  • 2020-11-27 13:23

    to know your php version

    php -v 
    

    for php 7.3.0

    sudo apt-get install php7.3-zip
    
    0 讨论(0)
  • 2020-11-27 13:24

    If you're facing this issue with macOS Catalina, I recommend these steps:

    1. 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)"

    2. Run brew install php@7.3

    3. Update your $PATH variable to include the newly installed version of php:

    echo 'export PATH="/usr/local/opt/php@7.3/bin:$PATH"' >> ~/.zshrc

    echo 'export PATH="/usr/local/opt/php@7.3/sbin:$PATH"' >> ~/.zshrc

    1. Reload your shell preferences script $ source ~/.zshrc or source ~/.bashrc

    2. Finally, install laravel: composer global require laravel/installer

    0 讨论(0)
  • 2020-11-27 13:25

    On centos 7 I have used:

    yum install php-pecl-zip
    

    because any other solution didn't work for me.

    0 讨论(0)
  • 2020-11-27 13:26
    V=`php -v | sed -e '/^PHP/!d' -e 's/.* \([0-9]\+\.[0-9]\+\).*$/\1/'` \
    sudo apt-get install php$V-zip
    
    0 讨论(0)
提交回复
热议问题