I recently installed and enabled oci8 extension for PHP 5.6
and using Apache 2.4.10
on CentOS 6.4
64-bit, using httpd, httpd-devel, php56w-* and mysql
.
I used the latest Instant Client at the time (12.1) and followed the instruction on Oracle website,
used both pecl install oci8
and phpize
options on installing oci8 2.0.8
, setting environment variables for both shell and Apache, mentioning modules/oci8.so
in php.d/oci8.ini
.
The problem is, I can call oci_connect()
by using php in terminal like php oci_test.php
, it works fine, but when I try running it from a browser, it returns Fatal error: Call to undefined function oci_connect()
. I have already read this solution but it didn't work, and both LD_LIBRARY_PATH and ORACLE_HOME are set correctly in both shell and httpd and php. (I intend to use yajra's work on oci for laravel so it doesn't use connection strings and generate it dynamically, so it doesn't need TNS_ADMIN or any .ora files)
It just works fine on my other Environment which is an XAMPP controller based Apache on Windows, manually upgraded to Apache 2.4.10 (64 ts vc11) and PHP 5.6 (64) using php_oci8_12c.dll provided by oracle.