php pdo oracle乱码的解决办法:首先在“nls_lang”设置编码;然后修改“/etc/init.d/php-fpm”;接着在头部增加“/etc/profile.d/oracle.sh”;最后重新启动php即可。
本文操作环境:windows7系统、php7.1版,dell g3电脑
php pdo oracle中文乱码
在/etc/profile.d/简历oracle.sh
内容如下在nls_lang设置编码
1 oracle_home=/usr/lib/oracle/12.1/client642 c_include_path=/usr/include/oracle/12.1/client643 ld_library_path=$oracle_home/lib4 #remember this is the client nls_lang not the server one5 nls_lang=french_france.utf8 6 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 fileif [ -f /etc/sysconfig/php-fpm ]; then. /etc/sysconfig/php-fpmfiif [ "$networking" = "no" ]thenexit 0firetval=0prog="php-fpm"pidfile=${pidfile-/var/run/php-fpm/php-fpm.pid}lockfile=${lockfile-/var/lock/subsys/php-fpm}
然后重新启动php即可
【推荐学习:php视频教程】
以上就是php pdo oracle 乱码怎么办的详细内容。