mysql - 免费的BSD。 nginx、php-fpm、PDO_mysql 驱动程序不起作用

标签 mysql nginx pdo php

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/

相关文章:

mysql - sphinx会和mysql数据源占用同样的内存空间吗?

mysql - 在 Glibc 2.11 上将 MySQL 5.1 更新到 5.6

mysql - 使用外键约束更新值

使用 Nginx 和 Docker 的 Angular 4 SEO

mysql - Perl mysql,为什么这个fetchrow_array 不起作用?

apache - 如何衡量 linux 中的基准测试

ssl - NGINX 重定向到 HTTPS 仅在刷新后有效

php - 如何在使用 PHP-PDO 记录查询时获取最后一个插入 ID

php - PDO 支持多个查询(PDO_MYSQL、PDO_MYSQLND)

php - 将订单 ID 与其所属产品相关联的最佳方式