Reputation: 69
I'm trying to enable extenion oci8
I uncommented its line in php.ini and added the required files for it ( oracle instant client).
Now from CMD, when I type: php --ri oci8, it shows :
oci8
OCI8 Support => enabled OCI8 DTrace Support => disabled OCI8 Version => 2.1.8 Revision => $Id: 4543974aab26d8a3d85257ab18d0dca4503ff9e7 $ Oracle Run-time Client Library Version => 12.1.0.2.0 Oracle Compile-time Instant Client Version => 12.1
Directive => Local Value => Master Value oci8.max_persistent => -1 => -1 oci8.persistent_timeout => -1 => -1 oci8.ping_interval => 60 => 60 oci8.privileged_connect => Off => Off oci8.statement_cache_size => 20 => 20 oci8.default_prefetch => 100 => 100 oci8.old_oci_close_semantics => Off => Off oci8.connection_class => no value => no value oci8.events => Off => Off
Statistics => Active Persistent Connections => 0 Active Connections => 0
So it should working fine. But when I try to connect to oracle from php I get error :
Call to undefined function Yajra\Pdo\oci_connect()
I opened to PHPINFO page, searched for oci8, the block that must be present to show it's enabled is not present.
What may be the problem? I'm using xampp 7.2 on windows 10
Upvotes: 0
Views: 2440
Reputation: 69
Solved.
It was that my PC required restart not just Apache for PHP web to load the new enviroment variables, which is important in locating oracle instant client, which is needed by the PHP extension OCI8.
The strange thing is that PHP CLI loaded the new enviroment variables, but the PHP web didn't load it although Apache is restarted. I noticed that from PHPinfo page, which displays the loaded envirmonment variables showing the old ones before adding oracle.
So just restated my PC and everything is now OK. Thanks for your advice.
Upvotes: 1
Reputation: 11
You must edit the php.ini file which is shown in phpinfo ("Loaded Configuration File ") option and apache restart is also required for it to work.
Upvotes: 0