工匠:找不到驱动程序 [英] Artisan: Could not find driver
问题描述
我正在使用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屋!