Answer the question
In order to leave comments, you need to log in
PHP7 + Oracle - how to set up encoding?
We have ubuntu 16.04 server in stock. Installed instantclient 11.2.0.4.0 (basic, devel and sqlplus) from rpms via alien (installing from zip gives the same result). The environment variables ORACLE_HOME, LD_LIBRARY_PATH and NLS_LANG are registered in both /etc/environment and /etc/profile, the file /etc/profile.d/oracle.sh is also created and imported into ~/.profile. Installed PHP 7.0.8 from the regular repository. The oci8 and pdo_oci extensions have been successfully compiled and included.
The code
try {
$pdo = new PDO("oci:dbname=DEVELOP", "user", "passwd");
echo "good connection with PDO";
} catch (Exception $e) {
echo $e->getMessage();
}
Answer the question
In order to leave comments, you need to log in
On the old version, I don't remember such a problem, on the new installation, everything is ok in cli, but not in fpm.
I tried everything, then returned everything back, but it helped, as it is written here
in the file /etc/php/5.6/fpm/pool.d/www.conf, to register (replace 12.2 with your version)
env[LD_LIBRARY_PATH] = /usr/lib/oracle/12.2/client64/lib
env[ORACLE_HOME] = /usr/lib/oracle/12.2/client64/lib
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question