使用XAMPP Server Linux(Ubuntu)在Laravel 4上迁移时找不到驱动程序 [英] Could not find driver while migrating on Laravel 4 using XAMPP Server Linux (Ubuntu)
问题描述
我已经安装了Laravel 4.1,一切正常,但是当我尝试使用迁移时,它会抛出PDO异常:
I have installed Laravel 4.1 everything worked just fine, but when I try to use migration it throws a PDO Exception saying:
[PDOException] 找不到驱动程序
[PDOException] could not find driver
我在StackOverFlow上找到了许多答案,但是不幸的是,没有一个答案能解决我的问题.
I found many answers on StackOverFlow, but none of them solved my problem, unfortunately.
我试图启用pdo扩展名和pdo_mysql扩展名,但是它说pdo已经加载.我试图重新安装PDO和PDO MySQL,但没有任何效果.
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.
我正在Ubuntu 64位计算机上使用XAMPP服务器.
I am using XAMPP Server on a Ubuntu 64bit machine.
谢谢.
推荐答案
问题已解决!
步骤:
-
卸载XAMPP
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
安装XAMPP
但是,我在运行php artisan
时遇到了一个新问题,然后我发现必须运行/opt/lampp/bin/php artisan
而不是php artisan
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上迁移时找不到驱动程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!