エラー内容
Deployerを使ってLaravelプロジェクトをデプロイしようとしたところ、artisan:migrateでcould not find driverエラーが発生する。
➤ Executing task artisan:migrate
[Deployer\Exception\RuntimeException (1)]
The command "/usr/bin/php /.../releases/1/server/artisan migrate --force" failed.
Exit Code: 1 (General error)
================
In Connection.php line 669:
could not find driver (SQL: select * from information_schema.tables where
table_schema = forge and table_name = migrations and table_type = 'BASE TABLE')
In Connector.php line 70:
could not find driver
原因
mysqlのドライバをインストールしていなかったため
対応
下記のコマンドでphpのmysqlndエクステンションをインストールする
yum install --enablerepo=remi php-mysqlnd
インストール後php -m
コマンドでインストールできたか確認する
$ php -m | grep mysql
mysqli
mysqlnd
pdo_mysql
こちらもおススメ