问题描述
我已经安装了 Laravel 4.1,一切正常,但是当我尝试使用迁移时,它会抛出一个 PDO 异常:
<块引用><块引用>[PDO异常]找不到驱动程序
我在 StackOverFlow 上找到了很多答案,但不幸的是,没有一个能解决我的问题.
我尝试启用 pdo 扩展和 pdo_mysql 扩展,但它说 pdo 已经加载.我尝试重新安装 PDO 和 PDO MySQL,但没有任何效果.
我在 Ubuntu 64 位机器上使用 XAMPP 服务器.
提前谢谢你.
问题解决了!
步骤:
卸载 XAMPP
apt-get update &&apt-get install lamp-server^
apt-get autoremove apache2
apt-get remove --purge mysql-server mysql-client mysql-common
apt-get autoremove &&apt-get 更新 &&apt-get install php5-mysql &&apt-get install pdo-mysql
安装 XAMPP
但是,我在运行 php artisan
时遇到了一个新问题,然后我发现我必须运行 /opt/lampp/bin/php artisan
而不是 php工匠
I have installed Laravel 4.1 everything worked just fine, but when I try to use migration it throws a PDO Exception saying:
[PDOException] could not find driver
I found many answers on StackOverFlow, but none of them solved my problem, unfortunately.
I have tried to enable pdo extension and pdo_mysql extension, but it says that pdo is already loaded. I have tried to reinstall PDO and PDO MySQL but nothing worked.
I am using XAMPP Server on a Ubuntu 64bit machine.
Thank you in advance.
The problem is solved!
Steps:
Uninstall XAMPP
apt-get update && apt-get install lamp-server^
apt-get autoremove apache2
apt-get remove --purge mysql-server mysql-client mysql-common
apt-get autoremove && apt-get update && apt-get install php5-mysql && apt-get install pdo-mysql
Install XAMPP
However, I had a new problem with running php artisan
then I discovered that I had to run /opt/lampp/bin/php artisan
instead of php artisan
这篇关于使用 XAMPP Server Linux (Ubuntu) 在 Laravel 4 上迁移时找不到驱动程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!