I am running FreeBSD 11.1, PHP 7.2, Apache 2.4, and some version of MySQL. The problem is that when I try to access the test page from the web, I get an error that says "Failed to connect to database: could not find driver." I made sure that pdo_mysql was installed, and it shows up on the list when I do
The only clues that I have are as follows:
Here is a partial screenshot of what phpinfo from the web looks like:
At this point, I have no idea what the problem is. So I am calling Uncle on this one.
So does anyone have any idea as to what I should look at?
php -m
as shown below (I formatted the lines horizontally so it wouldn't be so long).
Code:
strata:/usr/local/etc 1162 ### ->php -m
[PHP Modules]
Core ctype date dom filter hash iconv json libxml mysqlnd pcre PDO pdo_mysql pdo_sqlite Phar posix Reflection
session SimpleXML SPL sqlite3 standard tokenizer xml xmlreader xmlwriter Zend OPcache
[Zend Modules]
Zend OPcache
The only clues that I have are as follows:
- phpinfo() is telling me that it is using sqlite3 from the web.
- php -i says it has both pdo_sqlite3 and pdo_mysql from the command line.
- It's not the program, because it works correctly under Windows 10.
- phpinfo() on Windows from the web says it's using pdo_mysql.
Code:
PDO
PDO support => enabled
PDO drivers => mysql, sqlite
pdo_mysql
PDO Driver for MySQL => enabled
Client API version => mysqlnd 5.0.12-dev - 20150407 - $Id: 38fea24f2847fa7519001be390c98ae0acafe387 $
Directive => Local Value => Master Value
pdo_mysql.default_socket => no value => no value
pdo_sqlite
PDO Driver for SQLite 3.x => enabled
SQLite Library => 3.21.0
Here is a partial screenshot of what phpinfo from the web looks like:
At this point, I have no idea what the problem is. So I am calling Uncle on this one.
So does anyone have any idea as to what I should look at?