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

yipeiwu_com6年前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实现var_export的详细介绍

复制代码 代码如下:<?php/** * PHP 实现var_export();功能 */   $arr = array("1","2","...

phpmailer绑定邮箱的实现方法

phpmailer绑定邮箱的实现方法

本文实例讲述了phpmailer绑定邮箱的实现方法。分享给大家供大家参考,具体如下: 效果如下: 1.配置 <?php return array ( 'email...

PHP中Notice错误常见解决方法

对于初学者,肯定会遇到不同的错误提示,比如:警告,致命,等等,其中NOTICE错误等级最低,页面中,好多类似 Notice: Use of undefined constant titl...

php数组函数序列之sort() 对数组的元素值进行升序排序

sort()定义和用法 sort() 函数按升序对给定数组的值排序。 注释:本函数为数组中的单元赋予新的键名。原有的键名将被删除。 如果成功则返回 TRUE,否则返回 FALSE。 语法...

php中namespace use用法实例分析

本文实例讲述了php中namespace use用法。分享给大家供大家参考,具体如下: 现在说这个感觉有点过时了,但是感觉用namespace的人还是不多,估计还是因为不习惯吧。 cla...