2
0

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 3 years have passed since last update.

【Laravel】package不足でcomposer installができない

Posted at

既存のLaravelプロジェクトをインストールする工程で、composer installをしますが、

[ec2-user@ip-172-31-39-229 laravel]$ composer install
PHP Warning:  PHP Startup: Unable to load dynamic library 'pdo' (tried: /opt/remi/php74/root/usr/lib64/php/modules/pdo (/opt/remi/php74/root/usr/lib64/php/modules/pdo: cannot open shared object file: No such file or directory), /opt/remi/php74/root/usr/lib64/php/modules/pdo.so (/opt/remi/php74/root/usr/lib64/php/modules/pdo.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
No composer.lock file present. Updating dependencies to latest instead of installing from lock file. See https://getcomposer.org/install for more information.
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - doctrine/dbal[v2.10.0, ..., 2.13.x-dev] require ext-pdo * -> it is missing from your system. Install or enable PHP's pdo extension.
    - Root composer.json requires doctrine/dbal ^2.10 -> satisfiable by doctrine/dbal[v2.10.0, ..., 2.13.x-dev].
...

と出て、うまく動かなかった。

###エラー文:パッケージが不足している
ので、パッケージをインストールしていけばいいんですが、EC2だとインストールしたphpのバージョン毎に合わせて入れてあげる必要があります。

私の環境のphpのverionは7.4.22なので、

[ec2-user@ip-172-31-39-229 laravel]$ php -v
PHP 7.4.22 (cli) (built: Jul 27 2021 18:08:31) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies

php74-php-pdoをインストールすればいいのです。

[ec2-user@ip-172-31-39-229 laravel]$ sudo yum install -y php74-php-pdo

以上です。

2
0
0

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
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?