Welcome Guest, Not a member yet? Register   Sign In
Class "CodeIgniter\Database\oci8\Connection" not found
#1

This error is show on my server Ubuntu
I have tested out a simple application and it´s ok the connection
But in the CI4 appear this message.
The driver has installed and the extension is active on php.ini
Anyone could show me another option?
Reply
#2
Rainbow 

Post your database configuration for the oracle connection in database.php. 
It also helps as you post the code from your simple working code.
Reply
#3

(This post was last modified: 10-20-2023, 11:14 AM by gvalderlan.)

public array $homologacao = [
    'DSN'          => '',
    'hostname'      => '(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = host)(PORT = 1521)))(CONNECT_DATA = (SERVICE_NAME = service)(SERVER=DEDICATED)))',
    'username'      => 'user',
    'password'      => 'pass',
    'database'      => '',
    'DBDriver'      => 'oci8',
    'DBPrefix'      => '',
    'pConnect'      => true,
    'DBDebug'      => true,
    'charset'      => 'utf8',
    'DBCollat'      => 'utf8_general_ci',
    'swapPre'      => '',
    'encrypt'      => false,
    'compress'      => false,
    'strictOn'      => false,
    'failover'      => [],
    'port'          => 1521,
    'numberNative'  => false,
];


In my local server(WAMP) it´s ok, the application work, only on new server ubuntu appear this error;
[Image: ci4.jpg]

The simple code that work´s

$instancia = "(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = host)(PORT = 1521))(CONNECT_DATA = (SERVICE_NAME = service)))";

$conn = oci_connect('user', 'pass', $instancia);

if (!$conn) {
    $e = oci_error();
    trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
}

$stid = oci_parse($conn, 'SELECT TIPO FROM tabela WHERE COD = 8002');
oci_execute($stid);

$row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS);
var_dump($row);exit();
Reply
#4

There is no CodeIgniter\Database\oci8\Connection class,
but there is CodeIgniter\Database\OCI8\Connection class.
Reply
#5

(This post was last modified: 10-20-2023, 02:12 PM by kenjis.)

DBDriver
Supported drivers: MySQLi, Postgre, SQLite3, SQLSRV, and OCI8.
https://www.codeigniter.com/user_guide/d...-of-values
Reply
#6

(This post was last modified: 10-23-2023, 04:59 PM by kenjis.)

This solution solved my problem. Linux differentiates between uppercase and lowercase letters, and I hadn't paid attention to this when setting DBDriver = 'OCI8' in the configuration; now it worked. Thanks a lot for the help

(10-20-2023, 02:08 PM)kenjis Wrote: There is no CodeIgniter\Database\oci8\Connection class,
but there is CodeIgniter\Database\OCI8\Connection class.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB