I'm new to PHP and Oracle. I'm trying to make a connection between my application in PHP and an Oracle DataBase. I'm using:

Red Hat Enterprise Linux Server release 7.4 (Maipo)
PHP 5.4.16
Apache/2.4.6 (Red Hat Enterprise Linux)

In order to do that I installed Oracle Client and oci8, but I am having these:

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

Line 7 has:

$Conexion=oci_connect('user', 'pass','Ipaddress/DBname');

I read that it could a problem with environment variables

I have in /root/.bash_profile, the following text:

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

In /etc/sysconfig/httpd, I have:

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() shows me the following: Apache environment and Environment
PHP variables and Oci8

I don't know how to fix the problems, I'd appreciate any help

Thanks

0

There are 0 answers