Welcome Guest, Not a member yet? Register   Sign In
Oracle Database Connection with PHP 7.3.5 Latest Version
#1

Currently I'm working with oracle 11g db using codeigniter 3X and PHP Version 7.3.5 . I'm newbie to this db, when i try to make the connection. I got this error.

A PHP Error was encountered.


Code:
Severity: Notice
Message: Use of undefined constant OCI_COMMIT_ON_SUCCESS - assumed 'OCI_COMMIT_ON_SUCCESS'
Filename: database/DB.php
Line Number: 144

I've already enable extension in php.ini


Code:
;extension=php_mysqli.dll
extension=php_oci8.dll      ; Use with Oracle 10gR2 Instant Client
;extension=php_oci8_11g.dll  ; Use with Oracle 11gR2 Instant Client


Below is my code for [b]database.php :[/b]


Code:
$active_group = 'default';
$active_record = TRUE;
$db['default']['hostname'] = 'xxx.xxx.x.xx';
$db['default']['username'] = 'xxxx';
$db['default']['password'] = 'xxxx';
$db['default']['database'] = '';
$db['default']['dbdriver'] = 'oci8';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;

Below is the code at [b]controller :[/b]


Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Welcome extends CI_Controller {


   function __construct()  {
           parent::__construct(); 
   }

   function index()        {
           $this->db = $this->load->database('default',TRUE);

           if(!empty($this->db))
                   echo "Connected!"."\n";
           else
                   echo "Closed"."\n";
   }
}

I've been stuck on this problem almost 1 weeks. I also already searched the solution but nothing's work. can you help me ?

Some Developers Said [b]below solution, i'am also try that solution  but its not work for me. [/b]

Ans : 

It seems your oracle setup is not completed.


I'm not sure, but this PDF http://www.oracle.com/technetwork/topics...98250.html may help you.

So Can you Guide me  how to setup the oracle 11g Edition with PHP 7.3.5 Latest Version ?
Reply


Messages In This Thread
Oracle Database Connection with PHP 7.3.5 Latest Version - by eswarrao - 05-09-2019, 10:11 PM



Theme © iAndrew 2016 - Forum software by © MyBB