Discussions
Categories
- 196.9K All Categories
- 2.2K Data
- 239 Big Data Appliance
- 1.9K Data Science
- 450.3K Databases
- 221.7K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 550 MySQL Community Space
- 478 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3K ORDS, SODA & JSON in the Database
- 545 SQLcl
- 4K SQL Developer Data Modeler
- 187K SQL & PL/SQL
- 21.3K SQL Developer
- 295.9K Development
- 17 Developer Projects
- 138 Programming Languages
- 292.6K Development Tools
- 107 DevOps
- 3.1K QA/Testing
- 646K Java
- 28 Java Learning Subscription
- 37K Database Connectivity
- 155 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.1K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 18 Java Essentials
- 160 Java 8 Questions
- 86K Java Programming
- 80 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 204 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 440 LiveLabs
- 38 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 171 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 232 Portuguese
migrating from Apache to OHS facing problem with OCI8 "Uncaught Error: Call to undefined function oc
I have a website running up-end with Apache, PHP, Oracle Database.
I am trying to migrate to OHS by removing Apache, After installing OHS I was able to run the simple PHP file when I try to connect to Oracle Data Base I get this
error "Uncaught Error: Call to undefined function oci_connect()".
The strange thing, it work with Apache and not with OHS not sure what I am missing.
extension=php_oci8_12c.dll enable in php.ini file, I tired adding the folder "instantclient_11_2" in SYSTEM32 folder and added in System Environment variable still I get the same error.
Tried installing instantclient-basic too.
I am not able to figure out what went wrong.
Answers
-
Are you using Instant Client 11.2 or 12c?
You should enable the php_oci8_12c.dll extension with 12.1 or 12.2 version of Oracle Client or Instant Client not with Instantclient 11.2.
Also check the output of the following script with your OHS/PHP environment:
<?php
phpinfo();
?>
It'll show the OCI8 extension details if that extension is properly enabled.
If you want to check from command prompt, running "php -i" will show OCI8 extension details if it is installed properly.
-
Thanks for the reply.
Sorry a typo mistake using 12.1 instant client
Below is the "php -i" output regarding the OCI8
/**********************
oci8
OCI8 Support => enabled
OCI8 DTrace Support => disabled
OCI8 Version => 2.1.3
Revision => $Id: 03698b2e9b50593039b7ca292b2e3cf9eaf064b9 $
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.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
********************************************************/
As i told I have Apache & Oracle HTTPS Server(OHS)
1) PHP file in Apache folder Htdocs with <?php phpinfo(); ?> i can find OCI enabled
2) PHP file in OHS folder Htdocs with <?php phpinfo(); ?> I cannot find OCI enabled
Both Apache and OHS are reading the same PHP folder (C://PHP7) and have the same php.ini file