CodeIgniter Forums

Full Version: connection oracle9 error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hello, hope to get some help! I´m trying to connect to an oracle 9 on a codeigniter project but it does not work on oracle 9. On oracle 11 xe works fine. If I make a test outside project it connects to oracle 9 but in the  project does not wortk.

parameters oracle 11 xe that works:
$db['default'] = [
    'dsn'  => '',
    'hostname' => '192.168.1.29/xe',
    'username' => 'testdb',
    'password' => 'testdb',
    'database' => 'xe',
    'dbdriver' => 'oci8',
    'dbprefix' => '',
    'pconnect' => false,
    'db_debug' => (ENVIRONMENT !== 'production'),
    'cache_on' => false,
    'cachedir' => '',
    'char_set' => 'utf8',
    'dbcollat' => 'utf8_general_ci',
    'swap_pre' => '',
    'encrypt' => false,
    'compress' => false,
    'stricton' => false,
    'failover' => [],
    'save_queries' => true
];


parameters oracle 9 that dont work:

$db['default'] = [
    'dsn'  => '',
    'hostname' => '192.168.1.182/tsh1.world',
    'username' => 'testdb',
    'password' => 'testdb',
    'database' => 'tsh1.world',
    'dbdriver' => 'oci8',
    'dbprefix' => '',
    'pconnect' => false,
    'db_debug' => (ENVIRONMENT !== 'production'),
    'cache_on' => false,
    'cachedir' => '',
    'char_set' => 'utf8',
    'dbcollat' => 'utf8_general_ci',
    'swap_pre' => '',
    'encrypt' => false,
    'compress' => false,
    'stricton' => false,
    'failover' => [],
    'save_queries' => true
];


Test that worked on oracle 9 :
<?php

$conn=oci_connect("testdb","testdb","192.168.1.182/tsh1.world");

?>


I´m new on php, any tips?
@gutoazeredogyn,

What error message are you receiving?
(11-20-2020, 06:13 AM)php_rocs Wrote: [ -> ]@gutoazeredogyn,

What error message are you receiving?
Whoops \ Exception \ ErrorException (E_WARNING)

oci_connect(): ORA-12560: TNS:protocol adapter error


Both oracle 11 and oracle 9 are not in the machine with xampp. oracle 11 runs on windows 7 and oracle 9 on a red hat machine
@gutoazeredogyn,

What version of CI? Also, did you run the CI oracle 9 and Test oracle 9 on the same machine?
(11-20-2020, 01:10 PM)php_rocs Wrote: [ -> ]@gutoazeredogyn,

What version of CI?  Also, did you run the CI oracle 9 and Test oracle 9 on the same machine?
both tests on the same machine running xampp! Just  edited database.php of codeigniter project to test parameters. Test that runned ok on oracle 9 was on a simple projet that tests login and logout using oracle.

using instant client 1.4 and php_oci8.dll. params cheched on phpinfo and as I mentioned, working fine with the login/logout project on oracle 9.
any help?
@gutoazeredogyn,

Try in this file ... system/core/CodeIgniter.php
(11-23-2020, 12:28 PM)php_rocs Wrote: [ -> ]@gutoazeredogyn,

What version of CI?
I did not istall CI yet, but the project was done on him. Is there any file on the project that I can see the version of CI that it was created?
@gutoazeredogyn,

What is the directory layout? (assuming that you tried looking here system/core/CodeIgniter.php).
(11-23-2020, 12:28 PM)php_rocs Wrote: [ -> ]@gutoazeredogyn,

Try in this file ... system/core/CodeIgniter.php
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
* @package CodeIgniter
* @author ExpressionEngine Dev Team
* @copyright Copyright © 2008 - 2011, EllisLab, Inc.
* @license http://codeigniter.com/user_guide/license.html
* @LinK http://codeigniter.com
* @since Version 1.0
* @filesource
*/

// ------------------------------------------------------------------------

/**
* System Initialization File
*
* Loads the base classes and executes the request.
*
* @package CodeIgniter
* @subpackage codeigniter
* @category Front-controller
* @author ExpressionEngine Dev Team
* @LinK http://codeigniter.com/user_guide/
*/

/**
* CodeIgniter Version
*
* @var string
*
*/
define('CI_VERSION', '2.1.3');
Pages: 1 2