Oci_connect () works with terminal but not in apache environment

I recently installed and switched on for the expansion oci8 PHP 5.6

and use Apache 2.4.10

on CentOS 6.4

64-bit using httpd, httpd-devel, php56w-* and mysql

. At the time, I was using the latest Instant Client (12.1) and followed the instruction on the Oracle website, used the options pecl install oci8

and phpize

during installation oci8 2.0.8

, setting the environment variables for the shell and Apache pointing modules/oci8.so

to php.d/oci8.ini


The problem is that I can call oci_connect()

with php in the terminal like php oci_test.php

it works fine, but when I try to run it from the browser it returns Fatal error: Call to undefined function oci_connect()

. I 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 for oci for laravel, so it doesn't use connection strings and doesn't generate it dynamically, so it doesn't need TNS_ADMIN files or any .ora files)

It works fine on my other environment, which is Windows based XAMPP based Apache, manually updated to Apache 2.4.10 (64 ts vc11) and PHP 5.6 (64) using php_oci8_12c.dll provided by oracle.


source to share

All Articles