Sometimes, we want to fix PDOException “could not find driver” with PHP.
In this article, we’ll look at how to fix PDOException “could not find driver” with PHP.
How to fix PDOException “could not find driver” with PHP?
To fix PDOException “could not find driver” with PHP, we install the php-mysql
package.
To install it in Ubuntu, we run
sudo apt-get install php-mysql
Then we restart Apache with
sudo service apache2 restart
Conclusion
To fix PDOException “could not find driver” with PHP, we install the php-mysql
package.