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:
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
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 ofphp artisan
If you are looking for simple solution, I had same issue & this worked for me..
When you run
php artisan
from terminal, you invokephp5-cli
package.To run artisan with XAMPP's php you need to use:
/opt/lampp/bin/php artisan migrate
But make sure your
/opt/lampp/etc/php.ini
is properly configured to enable pdo_mysql