Solusi untuk error PHP “oci_connect(): OCIEnvNlsCreate() failed.” di Mac OS Sierra

less than 1 minute read

Setelah kemarin error Library not loaded tersolusikan, saat mencoba aplikasi yang koneksi ke database ada error lagi yang muncul:

Warning: oci_connect(): OCIEnvNlsCreate() failed. There is something wrong with your system - please check that DYLD_LIBRARY_PATH includes the directory with Oracle Instant Client libraries

Solusinya cukup mudah, buat symbolic link untuk file-file library libclntsh.dylib.11.1, libnnz11.dylib dan libociei.dylib yang ada di direktori instant client di direktori /usr/local/lib:

cd /usr/local/lib
ln -s /Library/Oracle/instantclient/11.2.0.4/libclntsh.dylib.11.1 .
ln -s /Library/Oracle/instantclient/11.2.0.4/libnnz11.dylib .
ln -s /Library/Oracle/instantclient/11.2.0.4/libociei.dylib .

Dan setelah restart Apache error tadi pun hilang. Semoga bermanfaat.

Comments