Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

php to odbc to oracle connection?

Options
  • 22-07-2008 1:36pm
    #1
    Registered Users Posts: 462 ✭✭


    can anyone give me a step by step guide to doing this.

    I have latest version of mysql php and apache installed data source set up to oracle db.

    tried using the odbc_connect function but go this error

    Warning: odbc_connect() [function.odbc-connect]: SQL error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified, SQL state IM002 in SQLConnect in C:\intranet\webserver\Apache2\htdocs\dundalkcu\test.php on line 16


    are there any other drivers that I need to install or enable any settings in php or apache.


Comments

  • Registered Users Posts: 23,212 ✭✭✭✭Tom Dunne


    Have you installed the oracle client software and can you confirm connectivity (outside of apache/php) to the Oracle?


  • Registered Users Posts: 1,393 ✭✭✭Inspector Gadget


    Hopefully this won't be an oversimplification, but go get the Oracle Instant Client from Oracle themselves (and the ODBC add-on libraries) from http://www.oracle.com/technology/software/tech/oci/instantclient/index.html (you'll have to register for Oracle Technet, I think, to be able to download these, but I could be wrong on that).

    Also, I don't know if this is true across the board, but the ODBC libraries only worked for me against the Basic (not the Basic "Lite") version of the version 11 Instant Client when I had to do this sort of thing a couple of weeks ago. Might save you some grief.

    Expand the Instant Client into a folder on your drive (preferably one with a simple path; it's usually wise to avoid spaces in folder names too, though I'm not sure if that's an issue for the instant client). Then uncompress the ODBC zip into the same folder. There's some batch file you have to run to register the Instant Client with ODBC (there are instructions with it for this).

    Then create an ODBC data source as normal - there should be plenty of descriptions of how to do this out there, least of all from Oracle themselves.

    Hope this helps,
    Gadget


Advertisement