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

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/49045941/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 17:27:23  来源:igfitidea点击:

laravel Installation failed, deleting ./composer.json

laravelcomposer-php

提问by MJ7

hi In Laravel Installation The following error occurred

嗨,在 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.

Installation failed, deleting ./composer.json. I'm using the latest composer version... php7 , mysql , apache2 already installed

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

回答by BadLog

Just need zip extension:

只需要 zip 扩展名:

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

回答by Alexandr Biship

it says the requested PHP extension zip is missing from your system.

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

you have to enable or install that.

您必须启用或安装它。

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

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

回答by Pratama Wisnu Samodro

if you use php 7.3

如果您使用 php 7.3

sudo apt-get install php7.3-curl

or simply if you are not sure with the version, just use code below

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

sudo apt-get install php7.2-curl

回答by JUAN DAVID Rod

I worked by previously installing Composer, after php.

我之前在 php 之后安装了 Composer。

Run: sudo apt-get install php7.2-zip

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

sudo apt-get install php7.2-curl

须藤 apt-get 安装 php7.2-curl