【发布时间】:2014-10-28 06:21:11
【问题描述】:
我正在使用即时 oracle 客户端 11.2,php 5.5.16,从源代码编译并具有以下配置参数:
'./configure' '--enable-fpm' '--enable-bcmath' '--with-bz2' '--enable-calendar' '--with-curl' '--enable-dba' '--enable-exif' '--enable-ftp' '--with-gd' '--with-gettext' '--with-kerberos' '--enable-mbstring' '--with-mcrypt' '--with-openssl' '--enable-shmop' '--enable-soap' '--enable-sockets' '--enable-sysvmsg' '--enable-wddx' '--enable-zip' '--with-zlib' '--with-xsl' '--with-mysql' '--with-mysqli' '--with-pgsql' '--with-pdo-mysql' '--with-pdo-pgsql' '--with-oci8' '--with-pdo-oci'
在我之前的配置中,我使用 apache2(--with-apxs2=/usr/bin/apxs2 而不是 --enable-fpm)与 oracle 和 oci8。我的数据源名称是:"oci:dbname=//IP:1521/SID;charset=UTF8"。
它工作得很好。
今天我想将此服务器配置从 apache 移动到 nginx 和 fpm。一切正常,除了在连接时,PDO 抛出:
OCIEnvNlsCreate: Check the character set is valid and that PHP has access to Oracle libraries and NLS data
我有完全相同的配置,除了 php-fpm 处理 php 而不是 apxs。
如果我删除 charset=UTF8 部分,它可以工作,但显然我遇到了字符集错误。我已将env[NLS_LANG]=FRENCH_FRANCE.UTF8 环境变量添加到我的php_fpm.conf 中,但没有成功。
如何使 nginx/php-fpm 配置正常工作?
【问题讨论】: