Usually uncomment it in php.ini.
How to install pdo_mysql to /usr/local/lib/php/pecl/20190902/ ?
Hi, I'm just started learning PHP. And I am using the built-in HTTP server on Mac (Monterey 12.4 & PHP Version 7.4.29).
When trying to connect with the MySQL database with PDO it shows:
could not find driver
I uncommented this line on the php.ini extension=pdo_mysql
But now the server shows:
PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_mysql' (tried: /usr/local/lib/php/pecl/20190902/pdo_mysql (dlopen(/usr/local/lib/php/pecl/20190902/pdo_mysql, 0x0009): tried: '/usr/local/lib/php/pecl/20190902/pdo_mysql' (no such file)), /usr/local/lib/php/pecl/20190902/pdo_mysql.so (dlopen(/usr/local/lib/php/pecl/20190902/pdo_mysql.so, 0x0009): tried: '/usr/local/lib/php/pecl/20190902/pdo_mysql.so' (no such file))) in Unknown on line 0
My understanding is (please correct me if I'm wrong) pdo_mysql is not installed in the PHP extension directory /usr/local/lib/php/pecl/20190902/
Is it possible to check if pdo_mysql is installed in any other directory?
Please let me know how I can solve it and make pdo_mysql work properly.
Please or to participate in this conversation.