php pdo oracle中文乱码的快速解决方法

yipeiwu_com5年前PHP代码库

在/etc/profile.d/简历oracle.sh

内容如下在NLS_LANG设置编码

ORACLE_HOME=/usr/lib/oracle/12.1/client64
C_INCLUDE_PATH=/usr/include/oracle/12.1/client64
LD_LIBRARY_PATH=$ORACLE_HOME/lib
#remember this is the client NLS_LANG not the server one
NLS_LANG=FRENCH_FRANCE.UTF8 
export ORACLE_HOME LD_LIBRARY_PATH NLS_LANG

然后修改 /etc/init.d/php-fpm

在头部增加

. /etc/profile.d/oracle.sh

. /etc/init.d/functions
. /etc/profile.d/oracle.sh
# Check that networking is up.
. /etc/sysconfig/network
# Additional environment file
if [ -f /etc/sysconfig/php-fpm ]; then
. /etc/sysconfig/php-fpm
fi
if [ "$NETWORKING" = "no" ]
then
exit 0
fi
RETVAL=0
prog="php-fpm"
pidfile=${PIDFILE-/var/run/php-fpm/php-fpm.pid}
lockfile=${LOCKFILE-/var/lock/subsys/php-fpm}

然后重新启动php即可

以上这篇php pdo oracle中文乱码的快速解决方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持【宜配屋www.yipeiwu.com】。

相关文章

在PHP中读取和写入WORD文档的代码

复制代码 代码如下:<?  // 建立一个指向新COM组件的索引  $word = new COM(”word.appl...

php中__destruct与register_shutdown_function执行的先后顺序问题

根据php手册的解析。 __destruct是 析构函数会在到某个对象的所有引用都被删除或者当对象被显式销毁时执行。 而register_shutdown_function是 Regis...

php+ajax登录跳转登录实现思路

当我们的用户进行系统登录时,用户名和密码的验证都是后端验证的。而且,用户登录状态也是要后端设置的,查询数据库后,用户名和密码正确,则在session中存储一个uuid,每个页面需要根据登...

PHP判断文件是否存在、是否可读、目录是否存在的代码

1、案例: 复制代码 代码如下: <?php $file = 'jb51.net.php'; if (is_readable($file) == false) { die('文件不...

PHP时间类完整实例(非常实用)

本文实例讲述了PHP时间类。分享给大家供大家参考,具体如下: <?php header("Content-type:text/html;Charset=utf-8");...