Solve PHP to Oracle connection problem

  • Status: Pending
  • Præmier: $50
  • Modtagne indlæg: 3

Konkurrence Instruktioner

QUICK JOB: PHP on Apache is showing an error connecting to Oracle DB. The same machine connecting to Oracle from the CLI (shell) is fine but inside Apache an error comes up when using oci_pconnect()

Sqlplus works fine, as does using php from the shell, so Oracle is listening. The paths below contain files also. Operating system is Centos and Oracle 11

The error is:

ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0/db_1/lib:/u01/app/oracle/product/11.2.0/db_1/rdbms/lib:/lib:/usr/lib
A PHP Error was encountered

Severity: Warning

Message: oci_pconnect(): OCIEnvNlsCreate() failed. There is something wrong with your system - please check that ORACLE_HOME and LD_LIBRARY_PATH are set and point to the right directories

Filename: models/mhl_model.php

Line Number: 85

A PHP Error was encountered

Severity: Warning

Message: oci_pconnect(): Error while trying to retrieve text for error ORA-01804

Filename: models/mhl_model.php

Line Number: 85

Unable to connect to database -

Anbefalede færdigheder

Offentlig Præciserings Opslagstavle

  • OscarR
    OscarR
    • 9 år siden

    Please check 1) if the ORACLE_HOME is readable by Apache. 2) Try to become apache user (ex. su - apache) and see if there any error message. 3 ) Create a shell for apache user (if any error on step 2) 4) Chek the Oracle community , I hope it helps you.

    • 9 år siden
  • bodcom
    Konkurrenceafholder
    • 9 år siden

    SOLVED: export LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0/db_1/lib:/lib:/usr/lib
    export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1

    at the end of /etc/sysconfig/httpd.conf

    • 9 år siden
  • Imara Software Solutions
    Imara Software Solutions
    • 9 år siden

    hey. is it in your localhost or the webserver?

    • 9 år siden
  • mnzl16
    mnzl16
    • 9 år siden

    could you please show me the source code?

    • 9 år siden

Sådan kommer du i gang med konkurrencer

  • Opret din konkurrence

    Opret din konkurrence Hurtigt og nemt

  • Få tonsvis af indlæg

    Få tonsvis af indlæg Fra hele verden

  • Tildel det bedste indlæg

    Tildel det bedste indlæg Download filerne - Nemt!

Opret en Konkurrence Nu eller slut dig til os i dag!