Call to undefined function oci_connect, php_oci8_12c.dll, windows 8.1, php5.6.6
Edit: Hmm. Trying this on Windows 8 appears to generate the same error as you specified. I'm currently investigating...
My mistake (I had enabled the wrong extension_dir
line). It works in Win8 just as documented below.
The following steps should be all you need to get OCI working with PHP (I've just verified this on a freshly installed Windows 2008 R2 Standard x64 virtual machine):
- Download and extract PHP (I used
C:\php
fromphp-5.6.7-nts-Win32-VC11-x86.zip
). - Download and extract InstantClient (I used
C:\instantclient_12_1
frominstantclient-basic-nt-12.1.0.2.0.zip
). - Add the above paths to the system path.
- Copy
c:\php\php.ini-production
toc:\php\php.ini
. - in
php.ini
:- enabled line
extension_dir = "ext"
. - enabled line
extension=php_oci8_12c.dll
.
- enabled line
- Install Microsoft Visual C++ 2010 Runtime (x86). This is needed for the OCI8 extension.
- Install Microsoft Visual C++ 2012 Runtime (x86). This is needed for PHP.
At this point running php --ri oci8
in a command prompt shows me the following output:
C:\>php --ri oci8
oci8
OCI8 Support => enabled
OCI8 DTrace Support => disabled
OCI8 Version => 2.0.9
Revision => $Id: f5a3ee1083d1ffa6adb5143efda6eafa210b8414 $
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
And checking for the oci_connect
function:
C:\>php -r "var_dump(function_exists('oci_connect'));"
bool(true)
Fatal error: Call to undefined function oci_connect() in Wamp
At the end of the 3 day, I found my fault. When I describe PATH in the "Environment Variables" menu, I add the "PATH" to "User Variables" part, not to "System Variables" part.
The error was that simple and it costs me 3 day, pay attention!
Connect PHP Oracle Database
the xampp runs on x86 or x64 version? an the oracle client should be in sync with xampp - same version!
Related Topics
Problems with Secure Bind to Active Directory Using PHP
Insert Multiple Data into Database in Yii 2
Php: Re Order Associative Array
How to Display Images from a Folder Using PHP - PHP
Nohup on Windows, Exec Without Waiting for Finish
How to Resolve the Error: SQL Authentication Method Unknown in Laravel-Mysql
Merge Two Png Images with PHP Gd Library
Set Woocommerce Cart Expiration
Differencebetween Crc32 and Crc32B
Error 1366 (Hy000): Incorrect String Value: '\Xf0\X9F\X98\X9C' for Column 'Comment' at Row 1
Setting $_Session Doesn't Work on Localhost Using Xampp
Elegant Way to Search an PHP Array Using a User-Defined Function
Selecting Rows Where a Field Is Null Using PHP Pdo Prepared Statements and MySQL