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
I was also getting the same error --> "[PDOException] could not find driver "
I realized that the php was pointing to /usr/bin/php instead of the lampp /opt/lampp/bin/php so i simply created and alias
alias php="/opt/lampp/bin/php"
also had to make update to the .env file to ensure the database access credentials were updated.
And guess what, it Worked!
You are missing a PDO driver.
First install the driver
For ubuntu: For mysql database.
sudo apt-get install php5.6-mysql/php7.2-mysql
You also can search for other database systems.
You also can search for the driver:
sudo apt-cache search drivername
Then Run the cmd php artisan migrate
If you are using arch based system like in manjaro
just use
sudo pacman -S php-sqlite
Restart your httpd
systemctl restart httpd
Had the same issue and just figured, website is running under MAMP's php, but when you call in command, it runs mac's(if no bash path modified). you will have issue when mac doesn't have those extensions.
run php -i to find out loaded extensions, and install those one you missed. or run '/Applications/MAMP/bin/php/php5.3.6/bin/php artisan {your command}' to use MAMP's
This worked for me:
sudo apt-get install php5-sqlite
This installed sqlite for php5, then I ran the php artisan migrate command again and worked perfectly.
This worked with me:(for pgsql: use 'pgsql' instead of 'mysql')
Step 1)
sudo apt-get install php-mysql
Step 2)
php artisan config:clear
Step 3)
php artisan config:cache
Step 4)
Then restart your server, and generate key again and migrate it, Its Done