I have a bad experience while installing laravel. However, I was able to do so and move to the next level. I used generators and created my migrations. But when I type the last command
php artisan migrate
It's throwing a PDOException - could not find driver.
'mysql' => array(
'driver' => 'mysql',
'host' => 'localhost',
'unix_socket' => '/Applications/MAMP/tmp/mysql/mysql.sock',
'database' => 'database',
'username' => 'root',
'password' => '',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
),
That's my configuration in config/database.php.
I tried searching on stackoverflow and laravel forums and people suggest that it's PDO problem and not artisan's or php's - I followed those suggestions like adding
extension=pgsql.so
extension=pdo_pgsql.so
in php.ini
No positive result. It always says [PDOException]could not find driver.
Can someone please help resolving this.
Environment that I am using: Mac, laravel 4, MAMP PRO with php 5.4.4
pdo_mysql.so
extension? – Ryleysudo a2enmod <module>
. Look at yourphpinfo()
if the driver is enabled. – Ryleyphpinfo()
- it shows that PDO drivers for sqlite, pgsql, mysql are enabled! – Simplephp -i | less
and looking to see if the PDO extension is actually being loaded. If not then you will need to amend your php.ini file that is used by the CLI which is not the same one as is used by Apache. It usually lives in the same directory as the PHP exe but thats on windows, not sure where it would be on a mac. but this guy does #2751080 – Balticpdo_mysql
inphp.ini
and needed it in php-cli.ini instead. Thanks! – Unreel