dongpo0409 2012-07-23 13:05
浏览 294

OCI8 PHP错误OCIEnvNlsCreate()失败

I am receiving random errors every so often when connecting/running Oracle SQL Commands. This works 99% of the day, but randomly for around 10 minutes we will get a load of the errors, and the SQL Queries all fail.

Sorry for all the below code, just trying to assist

Error is:

PHP Warning:  oci_connect() [<a href='function.oci-connect'>function.oci-connect</a>]:  OCIEnvNlsCreate() failed. There is something wrong with your system - please check that LD_LIBRARY_PATH includes the directory with Oracle Instant Client libraries in /var/www/db.php on line 59, referer: https://www.abc.com/abc.php

Oracle Instant Client:

root@server:/opt/oracle/instantclient# pwd
/opt/oracle/instantclient
root@server:/opt/oracle/instantclient# ls -l
total 99940
-rw-r--r-- 1 root root      238 2009-07-03 14:40 BASIC_README
-r--r--r-- 1 root root  1609607 2009-07-03 14:40 classes12.jar
-rwxr-xr-x 1 root root    67766 2009-07-03 14:40 genezi
lrwxrwxrwx 1 root root       17 2009-07-03 14:41 libclntsh.so -> libclntsh.so.10.1
-rwxr-xr-x 1 root root 19076649 2009-07-03 14:40 libclntsh.so.10.1
-r-xr-xr-x 1 root root  5656445 2009-07-03 14:40 libnnz10.so
lrwxrwxrwx 1 root root       15 2009-07-03 14:41 libocci.so -> libocci.so.10.1
-rwxr-xr-x 1 root root  1398244 2009-07-03 14:40 libocci.so.10.1
-rwxr-xr-x 1 root root 72698427 2009-07-03 14:40 libociei.so
-r-xr-xr-x 1 root root   120443 2009-07-03 14:40 libocijdbc10.so
-r--r--r-- 1 root root  1555682 2009-07-03 14:40 ojdbc14.jar
drwxrwxr-x 4 root root     4096 2008-02-17 08:58 sdk

Other useful info:

root@server:/# cat /etc/apache2/envvars
# envvars - default environment variables for apache2ctl
# Since there is no sane way to get the parsed apache2 config in scripts, some
# settings are defined via environment variables and then used in apache2ctl,
# /etc/init.d/apache2, /etc/logrotate.d/apache2, etc.
export APACHE_RUN_USER=www-data
export APACHE_RUN_GROUP=www-data
export APACHE_PID_FILE=/var/run/apache2.pid
export LD_LIBRARY_PATH=/opt/oracle/instantclient

Inside the script, We debug any errors, and email a report when these are encountered to try and debug the issue a bit further. I am doing the following:

if(isset($ocierr) && $ocierr!="")
   $mb.="Oracle OCI Error: ".$ocierr."

";

$mb.="Oracle Error Message: ".print_r($errmsg,true)."

";
$mb.="Debugging:
LD_LIBRARY_PATH: ".var_export(getenv('LD_LIBRARY_PATH'),true);

which returns:

Oracle Error Message: 
Cannot contact to Oracle

Debugging:
LD_LIBRARY_PATH: '/opt/oracle/instantclient'
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 keil的map文件中Image component sizes各项意思
    • ¥30 BC260Y用MQTT向阿里云发布主题消息一直错误
    • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
    • ¥15 划分vlan后,链路不通了?
    • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
    • ¥15 Vue3 大型图片数据拖动排序
    • ¥15 Centos / PETGEM
    • ¥15 划分vlan后不通了
    • ¥20 用雷电模拟器安装百达屋apk一直闪退
    • ¥15 算能科技20240506咨询(拒绝大模型回答)