Click here to Skip to main content
15,889,216 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am currently trying yo connect to oracle 12c, which has been installed on my local machine via php, using a XAMPP server. I am getting an error stating:

fatal error call to undefined function oci_connect() in php xampp
PLS help.
Thanks in advance.

What I have tried:

I have ttied to enable the below extension in my php.ini

;extension=php_oci8.dll
;extension=php_oci8_11.g.dll
by removing the ";" so that the results will below:

extension=php_oci8.dll
extension=php_oci8_11.g.dll

restarted the server after applying changes

I slso downloaded and installed the Oracle Instant Client yet no progress.
Posted
Updated 11-Jul-23 21:12pm

1 solution

See PHP: Installation - Manual: Configuring PHP with OCI8[^]:
Quote:
When using Oracle 10gR2 client libraries on Windows, uncomment the php.ini line extension=php_oci8.dll. When using Oracle 11gR2 or later client libraries, uncomment extension=php_oci8_11g.dll or extension=php_oci8.dll. With Oracle 12c libraries use extension=php_oci8_12c.dll or extension=php_oci8_11g.dll or extension=php_oci8.dll. Only one of these DLLs may be enabled at a time. DLLs with higher versions may contain more functionality. Not all DLLs may be available for all versions of PHP. Make sure extension_dir is set to the directory containing the PHP extension DLLs.

See also the Troubleshooting section:
Quote:
The most common problem with installing OCI8 is not having the Oracle environment correctly set. This typically appears as a problem using oci_connect() or oci_pconnect().

Quote:
On Windows, having multiple versions of Oracle on the one machine can easily cause library clashes unless care is taken to make sure PHP only uses the correct version of Oracle.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900