I’ve tried to connect to my database using basic code and error checking but when I try it gives this error :
Could not find driver"
even when I enable extension=pdo_mysql
.
By the way, when I do phpInfo(); it says that I’m on 8.0.30 if this can help.
Also, it says that the pdo drivers has novalue.
2
Answers
Make sure you have the
pdo_mysql
library installed in your PHPext/
folder. If it exists, you may have a typo in yourphp.ini
file (you need to uncommentextension=pdo_mysql
). Otherwise, you might first need to install the appropriate PDO database drivers.You can try list your extensions using
php -m
to ensure that PHP detects the library.You can also try the following command to ensure library is loaded and enabled.
otherwise: