工匠:找不到驱动程序 [英] Artisan: Could not find driver

查看:97
本文介绍了工匠:找不到驱动程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Laravel的最新版本:3.2.1.

当我在终端上运行它时

php artisan migration:install

我有此错误:

could not find driver

我在Google和Laravel的论坛上进行了一些搜索,

编辑

我已经激活了扩展名,这就是我在phpinfo()中所拥有的 --with-iconv' '--with-pdo-mysql=mysqlnd' '--with-pdo-pgsql=/opt/lampp/postgresql' '--with-pdo好像设置了我的pdo.

这是我的phpinfo()

的图片

编辑2 我做了一点测试:

<?php
try {
    $dbh = new PDO("mysql:host=localhost;dbname=jjimobiliaria", "root", "");
    foreach($dbh->query('SELECT * from pdo_test') as $row) {
        print_r($row);
    }
    $dbh = null;
} catch (PDOException $e) {
    print "Error!: " . $e->getMessage() . "<br/>";
    die();
}

返回:

Array ( [id] => 1 [0] => 1 [test_column] => TESTING!!! [1] => TESTING!!! )

所以我的PDO运行正常

解决方案

问题是我的计算机上安装了另一个版本的PHP,而我没有使用XAMPP PHP,因此sugin XAMPP PHP解决了该问题.

I'm using Laravel last version: 3.2.1.

When I run this on terminal:

php artisan migration:install

I have this error:

could not find driver

I made some searches on Google and on Laravel's Forum, nothing.

EDIT

I have activated the extension and this is what I have on phpinfo() --with-iconv' '--with-pdo-mysql=mysqlnd' '--with-pdo-pgsql=/opt/lampp/postgresql' '--with-pdo It looks like my pdo is set.

Here is an image of my phpinfo()

EDIT 2 I've made a little test:

<?php
try {
    $dbh = new PDO("mysql:host=localhost;dbname=jjimobiliaria", "root", "");
    foreach($dbh->query('SELECT * from pdo_test') as $row) {
        print_r($row);
    }
    $dbh = null;
} catch (PDOException $e) {
    print "Error!: " . $e->getMessage() . "<br/>";
    die();
}

And the return:

Array ( [id] => 1 [0] => 1 [test_column] => TESTING!!! [1] => TESTING!!! )

So my PDO is working perfectly

解决方案

The problem is that my computer had another version of PHP and I was not using the XAMPP PHP, sugin XAMPP PHP solved the problem.

这篇关于工匠:找不到驱动程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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