Laravel - 获取[PDOException]无法找到驱动程序

时间:2017-01-14 16:10:56

标签: php laravel pdo

我正在使用Lampp apache服务器,当我运行命令php artisan migrate时收到此错误消息:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_pdo_mysql.dll' - /usr/lib/php/20151012/php_pdo_mysql.dll: cannot open shared object file: No such file or directory in Unknown on line 0
[Illuminate\Database\QueryException] could not find driver (SQL: select * from information_schema.tables where table_schema = seo-cms and table_name = migrations)
[PDOException] could not find driver 

我从php.ini/opt/lamp/etc/php.ini启用了/etc/php/7.0/cli/php.ini的pdo扩展程序,我重新启动了服务器,但这还不够。我很可能错过了一些东西。你能帮帮我吗?

THX!

[UPDATE] enter image description here

1 个答案:

答案 0 :(得分:0)

我执行了这个:sudo apt-get install php-mysql并解决了我的问题。但我建议您放弃lampp并使用apache service2。在lampp

上安装和设置配置会更复杂