php - php無法通過 Composer 安裝 Laravel 安裝程序

  显示原文与译文双语对照的内容
119 4

我嘗試在我的Ubuntu電腦上安裝 Laravel 安裝程序,但是在安裝過程中我會得到這個錯誤。`Your要求無法解析為可以安裝的軟體包集。

 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个回答

100 1

它表示需要花費英鎊的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
# For php v7.2
sudo apt-get install php7.2-zip
原作者:
...