I have a Laravel 5.4 project on my Ubuntu 14.04 (VPS with Plesk 12.5.30). After creating the database and setted up the .env file with required information I ran php artisan migrate
and exceptions were thrown:
[Illuminate\Database\QueryException]
could not find driver (SQL: select * from information_schema.tables where table_schema = pmaramaldb and table_name = migrations)[PDOException]
could not find driver
My .env file has:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=pmaramaldb
DB_USERNAME=user
DB_PASSWORD=密码
I've followed most of the guides to solve this error and there wasn't any positive results:
Enabling Extension Solution:
php.ini文件是自动生成的,我猜这是由Plesk制作的.文件开头写道:
; ATTENTION!
;
; DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY,
; SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED.
So I've tried it anyway. After that I've restarted Apache and then tried again... Didn't work.
Installing php7.0-mysql Solution:
我还try 安装MySQL,以防:
user@server:/var/www/vhosts$sudo apt get install php7.0-mysql
莱恩多·利斯塔·德·帕奎特斯...赫乔
Creando árbol de dependencias
我不知道该怎么做.回声
php7.0-mysql is already the newest version.
没有现成的,没有现实化的,没有现实化的.
** SQL Lite Install Solution:**
我也try 过as question link说:sudo apt-get install php5-sqlite
,结果是:
user@server:/var/www/vhosts/system/maramal.io/etc$sudo apt获取安装php5 sqlite
莱恩多·利斯塔·德·帕奎特斯...赫乔
Creando árbol de dependencias
我不知道该怎么做.回声
php5-sqlite is already the newest version.个
没有现成的,没有现实化的,没有现实化的.
Composer Dump-autoload Solution:
It didn't work either. I've tried composer dump-autoload
and it didn't work.
运行命令php -i
后:
PDO
PDO support => enabled
PDO drivers =>
...
PHP Version => 5.6.30-1+deb.sury.org~trusty+1
Well, I am not sure if this has anything to do with the error, but the version shown by running php -v
is:
user@server:~/path$php-v
PHP5.6.30-1+deb.苏里.组织~trusty+1(cli)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0,版权所有(C)1998-2016 Zend Technologies
Zend OPcache v7.0.6-dev,版权所有(C)1999-2016,由Zend Technologies提供