LoginSignup
2
0

More than 3 years have passed since last update.

Laravel で Class 'PDO' not found エラー出たときの解決方法

Last updated at Posted at 2020-05-04
開発環境
centos6
vagrant
laravel7.0

はじめに

Laravelで以下のコマンドを打つと
このようなエラーが出たので解決方法を載せておきます。

[vagrant@localhost]$php artisan migrate
PHP Fatal error:  Class 'PDO' not found in .. 

原因

php-pdoがなかったからエラーが起きてしまった

解決方法

#php-pdoをyumでインストールする
[vagrant@localhost]$yum install php-pdo

#remiリポジトリを使っている場合はPHPのバージョンを確認する
[vagrant@localhost]$php -v

#バージョンにあったものをインストールする
[vagrant@localhost]$yum install --enablerepo=remi,remi-php73 php-pdo

#yumが使えない場合はインストールしてください
[vagrant@localhost]$yum install

これで解決できます!
他の記事も参考にしたい方は
こちらのLaravel で Class 'PDO' not found というエラーが出た場合の対処(CentOS7)
ご確認ください。

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