php-fpm 上的 PDO 驱动程序以及 FreeBSD 上的 nginx 出现问题
查看 php 模块:
#php -m
[PHP Modules]
...
mysql
mysqli
mysqlnd
openssl
pcre
PDO
pdo_mysql <-is here 0_o
pdo_sqlite
Phar
posix
Reflection
session
SimpleXML
SPL
sqlite3
...
[Zend Modules]
PDO 已启用: # php --ri pdo
PDO
PDO support => enabled
PDO drivers => mysql, sqlite
PHP FPM 信息
# php-fpm -i
...
PDO
PDO support => enabled
PDO drivers => mysql, sqlite
pdo_mysql
PDO Driver for MySQL => enabled
Client API version => mysqlnd 5.0.10 - 20111026 - $Id: c85105d7c6f7d70d609bb4c000257868a40840ab $
Directive => Local Value => Master Value
pdo_mysql.default_socket => /tmp/mysql.sock => /tmp/mysql.sock
pdo_sqlite
PDO Driver for SQLite 3.x => enabled
SQLite Library => 3.8.7.2
...
我接受了这个错误:
2014/12/24 21:46:17 [error] 99501#0: *3930 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught exception 'PDOException' with message 'could not find driver
' in /usr/home/anmall/bitmachinegewerh/client/lib/user/profile.php:22
Stack trace:
#0 /usr/home/anmall/bitmachinegewerh/client/lib/user/profile.php(22): PDO->__construct('mysql:host=loca...', '***', '****', Array)
#1 /usr/home/anmall/bitmachinegewerh/client/public/awesome.php(10): User->connectDB()
#2 {main}
thrown in /usr/home/anmall/bitmachinegewerh/client/lib/user/profile.php on line 22" while reading response header from upstream, client: 46.48.252.89, server: bitmach
inegewerh.su, request: "POST /client/public/awesome.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "bitmachinegewerh.su", referrer: "http://bitmachinegewerh
.su/client/public/login.php"
最后我在 phpinfo() 中没有看到 PDO_Mysql 驱动程序;
最佳答案
我正在使用 Archlinux 并遇到了同样的问题。
我通过重新启动 php-fpm
服务修复了这个问题。
关于mysql - 免费的BSD。 nginx、php-fpm、PDO_mysql 驱动程序不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27641212/