My server is centos7, I managed to setup apache,php7.1,oracle-instantclient18.3-basic and oci8 on it. OCI8 is working fine now when I run the code on CLI, it connects the db and fetches data, only with one warning (also appears on running php -v) :
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/pdo_oci.so' - /usr/lib64/php/modules/pdo_oci.so: undefined symbol: php_pdo_unregister_driver in Unknown on line 0
unlike when I open up the page via browser (on a client machine) I got this error:
Fatal error: Uncaught Error: Call to undefined function oci_connect() in /var/www/html/pcmapi/emp.php:5 Stack trace: #0 {main} thrown in /var/www/html/pcmapi/emp.php on line 5
phpinfo() returns:
oci8
OCI8 Support => enabled
OCI8 DTrace Support => enabled
OCI8 Version => 2.1.8
Oracle Run-time Client Library Version => 18.3.0.0.0
Oracle Compile-time Instant Client Version => 18.3
Directive => Local Value => Master Value
oci8.connection_class => no value => no value
oci8.default_prefetch => 100 => 100
oci8.events => Off => Off
oci8.max_persistent => -1 => -1
oci8.old_oci_close_semantics => Off => Off
oci8.persistent_timeout => -1 => -1
oci8.ping_interval => 60 => 60
oci8.privileged_connect => Off => Off
oci8.statement_cache_size => 20 => 20
I cannot actually recognize what causes the fatal error whether in apache or oci configuration and I find it strange that oci functions are working fine on cli but not apache. any help?
Thanks for your time, I actually did reinstall all the environment over again, this was painful as its a production server but paid back.. while I had mysql & instantclient already setup, I removed php & httpd then reinstall them all as the following:
yum install httpd php php-mysql php-devel php-oci8 php-pear mod_ssl
and then:
service httpd restart
now it works.