使用 XAMPP Server Linux (Ubuntu) 在 Laravel 4 上迁移时找不到驱动程序 [英] Could not find driver while migrating on Laravel 4 using XAMPP Server Linux (Ubuntu)

查看:30
本文介绍了使用 XAMPP Server Linux (Ubuntu) 在 Laravel 4 上迁移时找不到驱动程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了 Laravel 4.1,一切正常,但是当我尝试使用迁移时,它会抛出一个 PDO 异常:

<块引用><块引用>

[PDO异常]找不到驱动程序

我在 StackOverFlow 上找到了很多答案,但不幸的是,没有一个能解决我的问题.

我尝试启用 pdo 扩展和 pdo_mysql 扩展,但它说 pdo 已经加载.我尝试重新安装 PDO 和 PDO MySQL,但没有任何效果.

我在 Ubuntu 64 位机器上使用 XAMPP 服务器.

提前谢谢你.

解决方案

问题解决了!

步骤:

  1. 卸载 XAMPP

  2. apt-get update &&apt-get install lamp-server^

  3. apt-get autoremove apache2

  4. apt-get remove --purge mysql-server mysql-client mysql-common

  5. apt-get autoremove &&apt-get 更新 &&apt-get install php5-mysql &&apt-get install pdo-mysql

  6. 安装 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:

  1. Uninstall XAMPP

  2. apt-get update && apt-get install lamp-server^

  3. apt-get autoremove apache2

  4. apt-get remove --purge mysql-server mysql-client mysql-common

  5. apt-get autoremove && apt-get update && apt-get install php5-mysql && apt-get install pdo-mysql

  6. 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 上迁移时找不到驱动程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆