As you found, PHP was built with a newer set of Oracle libraries than it was using at runtime.
Regarding setting environment variables, see p78 of The Underground PHP and Oracle Manual Note the "Setting values with Apache's SetEnv directive will not work."
Thanks for the note. I've gone through the book many times and there are steps that are simply unclear. I managed to get my environment working correctly after installing both the 2 rpms from oracle and not installing oci8 as an integral part of PHP but as a shared library and simply adding the extension oci8.so to PHP.ini.
Also to note you must fix the APXS Mealink Note: 1163665.1
#> rpm -ivh oracle-instantclient11.2-basic-184.108.40.206.0-1.x86_64.rpm #> rpm -ivh oracle-instantclient11.2-devel-220.127.116.11.0-1.x86_64.rpm The first RPM puts the Oracle libraries in /usr/lib/oracle/11.2/client64/lib The second creates headers in /usr/include/oracle/11.2/client64 #> export ORACLE_BASE=/u01/app/oracle #> export ORACLE_HOME=$ORACLE_BASE/middleware/webtier_1 #> export ORACLE_INSTANCE=$ORACLE_HOME/instances/inst_1 #> export INSTANT_CLIENT_HOME=/usr/lib/oracle/11.2/client64 #> export CONFIG_FILE_PATH=$ORACLE_INSTANCE/config/OHS/ohs1 #> export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/ohs/lib:$ORACLE_HOME/opmn/lib:$LD_LIBRARY_PATH #> ./configure --with-apxs2=$ORACLE_HOME/ohs/bin/apxs --prefix=$ORACLE_HOME --with-config-file-path=$CONFIG_FILE_PATH --with-oci8=shared,instantclient,$INSTANT_CLIENT_HOME/lib --disable-rpath