4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Laravel を composer からインストールできない

Posted at

概要

composer global require laravel/installer
このURL:https://laravel.com/docs/5.8からのコピペでインストールしようとしたが、エラーで弾かれた。

環境

  • CentOS7
  • php7.2

エラー内容

$ composer global require laravel/installer

Changed current directory to /home/ec2-user/.config/composer
Using version ^2.1 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
    - Installation request for laravel/installer ^2.1 -> satisfiable by laravel/installer[v2.1.0].
    - laravel/installer v2.1.0 requires ext-zip * -> the requested PHP extension zip is missing from your system.

  To enable extensions, verify that they are enabled in your .ini files:
    - /etc/opt/remi/php72/php.ini
    - /etc/opt/remi/php72/php.d/20-bz2.ini
    - /etc/opt/remi/php72/php.d/20-calendar.ini
    - /etc/opt/remi/php72/php.d/20-ctype.ini
    - /etc/opt/remi/php72/php.d/20-curl.ini
    - /etc/opt/remi/php72/php.d/20-exif.ini
    - /etc/opt/remi/php72/php.d/20-fileinfo.ini
    - /etc/opt/remi/php72/php.d/20-ftp.ini
    - /etc/opt/remi/php72/php.d/20-gettext.ini
    - /etc/opt/remi/php72/php.d/20-iconv.ini
    - /etc/opt/remi/php72/php.d/20-json.ini
    - /etc/opt/remi/php72/php.d/20-phar.ini
    - /etc/opt/remi/php72/php.d/20-sockets.ini
    - /etc/opt/remi/php72/php.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.

原因

  • phpのZIPが利用出来ないためのエラーだった
  • yum install php-zip が出来なかった

解決方法

試しに以下のコードを打ったところ[php72-php-pecl-zip]がインストールされた
yum install php72-php-zip

このあとに、composer global require laravel/installer を実行したら普通にコマンドが通りました。
★php-zip という古い記事にかかれたものは、入りませんでした。

4
4
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?