laravel安装失败,删除./composer.json

时间:2018-03-01 08:54:04

标签: laravel composer-php

嗨在Laravel安装中 发生以下错误

user@user-System-Product-Name:/$ composer global require "laravel/installer"
Changed current directory to /home/user/.config/composer

Using version ^2.0 for laravel/installer
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
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.0 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:
    - /etc/php/7.1/cli/php.ini
    - /etc/php/7.1/cli/conf.d/10-mysqlnd.ini
    - /etc/php/7.1/cli/conf.d/10-opcache.ini
    - /etc/php/7.1/cli/conf.d/10-pdo.ini
    - /etc/php/7.1/cli/conf.d/20-calendar.ini
    - /etc/php/7.1/cli/conf.d/20-ctype.ini
    - /etc/php/7.1/cli/conf.d/20-exif.ini
    - /etc/php/7.1/cli/conf.d/20-fileinfo.ini
    - /etc/php/7.1/cli/conf.d/20-ftp.ini
    - /etc/php/7.1/cli/conf.d/20-gettext.ini
    - /etc/php/7.1/cli/conf.d/20-iconv.ini
    - /etc/php/7.1/cli/conf.d/20-json.ini
    - /etc/php/7.1/cli/conf.d/20-mcrypt.ini
    - /etc/php/7.1/cli/conf.d/20-mysqli.ini
    - /etc/php/7.1/cli/conf.d/20-pdo_mysql.ini
    - /etc/php/7.1/cli/conf.d/20-phar.ini
    - /etc/php/7.1/cli/conf.d/20-posix.ini
    - /etc/php/7.1/cli/conf.d/20-readline.ini
    - /etc/php/7.1/cli/conf.d/20-shmop.ini
    - /etc/php/7.1/cli/conf.d/20-sockets.ini
    - /etc/php/7.1/cli/conf.d/20-sysvmsg.ini
    - /etc/php/7.1/cli/conf.d/20-sysvsem.ini
    - /etc/php/7.1/cli/conf.d/20-sysvshm.ini
    - /etc/php/7.1/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.

Installation failed, deleting ./composer.json.

安装失败,删除./composer.json。 我正在使用最新的作曲家版本...... php7,mysql,apache2已经安装

5 个答案:

答案 0 :(得分:3)

只需要拉链扩展名:

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

答案 1 :(得分:2)

它说the requested PHP extension zip is missing from your system.

你必须启用或安装它。

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

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

答案 2 :(得分:1)

唯一帮助我的是使用Brew将PHP更新到7.4。

brew install php@7.4

没有其他东西对我有用。

答案 3 :(得分:0)

如果您使用的是php 7.3

sudo apt-get install php7.3-curl

或者只是如果您不确定版本,只需使用下面的代码

sudo apt-get install php7.2-curl

答案 4 :(得分:0)

我以前是在php之后安装Composer的。

运行: sudo apt-get install php7.2-zip

sudo apt-get install php7.2-curl