2017-09-05 219 views
18

我試圖在我的Ubuntu PC上安裝與作曲家laravel安裝程序,但在安裝過程中出現此錯誤。 `您的需求無法解析爲一套可安裝的軟件包。無法通過作曲家安裝laravel安裝程序

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. 
` 

的錯誤,那麼會出現我用這個評論:

composer global require "laravel/installer" 
+0

聽起來像是你需要安裝的[php的zip擴展 – aynber

+3

可能的複製如何Ubuntu上安裝這些PHP擴展? ](https://stackoverflow.com/questions/41589180/how-do-i-install-these-php-extensions-on-ubuntu) – aynber

回答

48

它說,它需要zip擴展

laravel /安裝V1.4.0需要EXT-ZIP .. ......

安裝版本各自對安裝了PHP版本:

# For php v7.0 
sudo apt-get install php7.0-zip 

# For php v7.1 
sudo apt-get install php7.1-zip 
11

對於PHP7.1安裝此

sudo apt-get install php7.1-zip