In system level, I can connect to database using the wallet name, but sometimes, got below error:
1) PHP Warning: oci_connect(): ORA-12715: invalid character set specified
2) ORA-01017: invalid username/password; logon denied
3) PHP Warning: oci_connect(): OCIEnvNlsCreate() failed. There is something wrong with your system
PHP and Oracle oci_connect() fails sometimes, I tried change Character Set, cannot fix it.
In PHP,
putenv("TNS_ADMIN=/opt/.wallet");
putenv("ORACLE_HOME=/usr/app/oracle/product/11.2.0.3");
putenv("LD_LIBRARY_PATH=/usr/app/oracle/product/11.2.0.3/lib");
$conn = oci_connect("/", "", "WalletName", null, OCI_CRED_EXT);
In /etc/sysconfig/httpd:
export ORACLE_HOME=/usr/app/oracle/product/11.2.0.3
export LD_LIBRARY_PATH=/usr/app/oracle/product/11.2.0.3/lib
export TNS_ADMIN=/opt/.wallet
No comments:
Post a Comment