Forum Stats

  • 3,733,838 Users
  • 2,246,829 Discussions
  • 7,856,890 Comments

Discussions

migrating from Apache to OHS facing problem with OCI8 "Uncaught Error: Call to undefined function oc

3807919
3807919 Member Posts: 3
edited October 2018 in PHP

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

  • Sdhamoth-Oracle
    Sdhamoth-Oracle Member Posts: 184 Employee
    edited October 2018

    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.

  • 3807919
    3807919 Member Posts: 3
    edited October 2018

    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

    pastedImage_2.png

    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

Sign In or Register to comment.