我是PHP和Oracle的新手 . 我正在尝试在PHP中的应用程序和Oracle DataBase之间 Build 连接 . 我正在使用:
红帽企业Linux服务器版本7.4(Maipo)
PHP 5.4.16
Apache / 2.4.6(红帽企业Linux)
为了做到这一点,我安装了Oracle Client和oci8,但我有这些:
Warning: oci_connect(): 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/html/TTS/Portal/Recursos/php/login/Login.php on line 7
Warning: oci_connect(): Error while trying to retrieve text for error ORA-01804 in /var/www/html/TTS/Portal/Recursos/php/login/Login.php on line 7
第7行有:
$Conexion=oci_connect('user', 'pass','Ipaddress/DBname');
我读到它可能是环境变量的问题
我在/root/.bash_profile中,有以下文字:
export ORACLE_HOME=/usr/lib/oracle/12.2/client64
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export NLS_LANG=American_America.UTF8
PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export PATH
在/ etc / sysconfig / httpd中,我有:
LANG=C ORACLE_HOME=/usr/lib/oracle/12.2/client64
LD_LIBRARY_PATH=$ORACLE_HOME/lib
NLS_LANG=American_America.UTF8
export ORACLE_HOME
export LD_LIBRARY_PATH
export NLS_LANG
phpinfo()向我展示了以下内容:Apache environment and Environment
PHP variables and Oci8
我不知道如何解决问题,我很感激任何帮助
谢谢