Giter VIP home page Giter VIP logo

Comments (21)

yajra avatar yajra commented on July 17, 2024

Can you please provide the error details or screenshot and the environment you are using?

On the other hand, I think some WAMP installation is not working well with oci8. I suggest using Zend CE/Free Edition as one of my friend uses WAMP and having some issue too. When he changed to Zend, all works well. Just in case you are using wamp.

from laravel-oci8.

salluri27 avatar salluri27 commented on July 17, 2024

I am unable to connect to oracle database using pdo-via-oci8 driver. I am developing on linux server.

from laravel-oci8.

warroyo avatar warroyo commented on July 17, 2024

Ok I have solved the issue. I am able to connect successfully all the time except for when I try to dynamically set the db config. is i use the "config::set" function and attempt to specify the "pdo-via-oci8" driver that way it fails. you must specify the driver in the config database.php

from laravel-oci8.

salluri27 avatar salluri27 commented on July 17, 2024

I did set the driver information in the database.php config file.

from laravel-oci8.

warroyo avatar warroyo commented on July 17, 2024

can you please post your config settings

from laravel-oci8.

salluri27 avatar salluri27 commented on July 17, 2024
    'oracle' => array(
        'driver' => 'pdo-via-oci8',
        'host' => '',
        'port' => '1521',
        'database' => '', // Service ID
        'username' => '',
        'password' => '',
        'charset' => 'utf8',
        'prefix' => '',
    ),

from laravel-oci8.

warroyo avatar warroyo commented on July 17, 2024

I am assuming you have the 'host', 'username', and 'password' filled in and you just removed them for posting? becuase if you do not have those, then it will not connect.

from laravel-oci8.

salluri27 avatar salluri27 commented on July 17, 2024

I tried to display the connection the connection error. Here is what I see

oci_connect(): OCIEnvNlsCreate() failed. There is something wrong with your system - please check that LD_LIBRARY_PATH includes the directory with Oracle Instant Client libraries

from laravel-oci8.

salluri27 avatar salluri27 commented on July 17, 2024

I removed them for security purpose

from laravel-oci8.

warroyo avatar warroyo commented on July 17, 2024

that looks like you do not have the oci8 module installed in php. you will need this and the instant client in order for the package to work.

from laravel-oci8.

salluri27 avatar salluri27 commented on July 17, 2024

All other applications on my linux server are working. They connect to the oracle database successfully . I only have problem with it when I connect to it using Laravel Framework. I am new to Laravel.

from laravel-oci8.

warroyo avatar warroyo commented on July 17, 2024

do you have the instant client location in your LD_LIBRARY_PATH as it says?

from laravel-oci8.

salluri27 avatar salluri27 commented on July 17, 2024

I am using latest version of PHP 5.5.5 . My oci8 version 1.4.10 . I don't know if they are compatible. Previously I have some problem when I worked on WAMP server

from laravel-oci8.

yajra avatar yajra commented on July 17, 2024

you need to have Basic and the SDK Instant Client installed on your machine for oci8 to work properly. In some cases, if you are using Oracle 11g, you might as well use the oci811g extension instead of oci8 (have done this on my windows virtual machine). See link below for some reference.

http://www.oracle.com/technetwork/articles/technote-php-instant-084410.html

from laravel-oci8.

salluri27 avatar salluri27 commented on July 17, 2024

I am not actually working on windows. I am working on Linux box. It has the latest versions of php, oci8 driver and oracle instant client

from laravel-oci8.

crazycodr avatar crazycodr commented on July 17, 2024

A quick drop in on that long issue....

PDO via OCI8 is just a layer i created to map oci8 functions to a PDO driver. It is not a driver in itself, just a layer over existing functions. Same thing goes for Laravel via Oci8.

The first thing you should check and fix is : Can you connect to the oracle server using standalone methods such as the following code below? (Just change the settings to yours)

$conn = oci_connect('hr', 'welcome', 'localhost/XE');
if (!$conn) {
    $e = oci_error();
    var_dump($e);
}

If you can't connect using this, then PDO via Oci8 won't work... It's not a driver in itself, just a layer to simplify things.

I then suggest revising your whole configuration from the ground up...

If you say that other applications are connecting successfully, compare their settings:

  • Are they PHP?
  • Are they using the same OCI8 extension?
  • Using PHPInfo(), can you spot differences in the config of one application and another?

Ensure the native oci8 functions work and then pdo via oci8 will work.

from laravel-oci8.

warroyo avatar warroyo commented on July 17, 2024

can you please "echo $LD_LIBRARY_PATH" on your lunix machine. according to the error, it could be as simple as including the libraries in your path. can you please respond with the result of the echo.

from laravel-oci8.

salluri27 avatar salluri27 commented on July 17, 2024

Sorry for the confusion I have created. None of the applications are working on this box.
Should I have oracle instant client installed on Linux box for oci8 to work?

from laravel-oci8.

salluri27 avatar salluri27 commented on July 17, 2024

I echoed it. It is not displaying anything . This path is not set on my linux box. It is the new server I am working on.

from laravel-oci8.

warroyo avatar warroyo commented on July 17, 2024

that will definitely be a problem, have you tried what @crazycodr suggested? Do you have the oci8 php extension installed? also do you have the instant client installed?

if you have both oci8 and the instant client, you will need to get the path to the instant client libraries and add it to your LD_LIBRARY_PATH.

to add it to your path simply:

export LD_LIBRARY_PATH=/full/path/to/oracle/instant/client

from laravel-oci8.

salluri27 avatar salluri27 commented on July 17, 2024

The problem is with my environment set up. I didn't have the oracle instant client installed on my linux server. After installing it, it started working. Thank u all for helping me fix this issue. And pdo-via-oci8 driver is working perfect. Thanks once again.

from laravel-oci8.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.