M
M
MrChen2020-06-14 03:41:03
PHP
MrChen, 2020-06-14 03:41:03

Why is it impossible to connect to the database in php?

Hello! There was a problem with php on mac OSX Catalina. When trying to connect to the database via PDO, the following error occurs:
Can't connect to database: could not find driver

php -m gives:

[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dba
dom
exif
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
intl
json
ldap
libxml
mbstring
mysqli
mysqlnd
odbc
openssl
pcntl
pcre
PDO
pdo_dblib
pdo_mysql
PDO_ODBC
pdo_pgsql
pdo_sqlite
pgsql
Phar
phpdbg_webhelper
posix
pspell
readline
Reflection
session
shmop
SimpleXML
soap
sockets
sodium
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tidy
tokenizer
wddx
xml
xmlreader
xmlrpc
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache


I tried to connect pdo_mysql in php.ini, but it shows that there is no such extension. PHP installed via brew install [email protected]

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question