2012-05-23

ORA-24315 in PHP function oci_connect

ORA-24315 When Calling PHP Program [ID 1446995.1]

Applies to:

Oracle Fusion Middleware - Version: 11.1.1.2.0 to 11.1.1.6.0 - Release: Oracle11g to Oracle11g
Information in this document applies to any platform.

Symptoms

After doing a new installation of the Fusion Middleware 11g, the opmnctl is started by oracle user. 

Fixed Width Font
$ ./opmnctl startall
opmnctl startall: starting opmn and all managed processes...

$ ./opmnctl status
Processes in Instance: instance1
-----------------+---------------------+-------+---------
ias-component |          process-type |       pid | status
-----------------+---------------------+-------+---------
webcache1        | WebCache-admin | 27206 | Alive
webcache1        | WebCache             | 27205 | Alive
ohs1                   | OHS                       | 27204 | Alive


But when calling the PHP URL, the following error occurs:


http://hostname.domain:7777/test.php
Warning: oci_connect():
ORA-24315: illegal attribute type in ORACLE_HOME/instances/instance1/config/OHS/ohs1/htdocs/dbtest01.php on line 11 Fatal error: Could not connect to database:
ORA-24315: illegal attribute type in ORACLE_HOME/instances/instance1/config/OHS/ohs1/htdocs/dbtest01.php on line 14

Cause

The OCI libraries are missing; these missing client OCI libraries prevent PHP from connecting to the database.

Solution

There are 2 ways to resolve this issue.

OPTION A)


1) Take a backup of this folder:


$ORACLE_HOME/ohs/lib/*
---------------------------
-rw-r----- 1 oracle oinstall  156717 Oct 28 2009 ORACLE_HOME/ohs/lib/libexpat.so.0
-rw-r----- 1 oracle oinstall 2431224 Oct 28 2009 ORACLE_HOME/ohs/lib/libxml2.so
-rw-r----- 1 oracle oinstall 2431224 Oct 28 2009 ORACLE_HOME/ohs/lib/libxml2.so.2
-rw-r----- 1 oracle oinstall  135122 Oct 28 2009 ORACLE_HOME/ohs/lib/libz.so
-rwxr-x--- 1 oracle oinstall  177670 Oct 28 2009 ORACLE_HOME/ohs/lib/ohs.jar



2) Now, add or modify the LD_LIBRARY_PATH definition in opmn.xml to include the INSTANT_CLIENT_HOME/client64/lib directory:
i.e.:

<variable id="LD_LIBRARY_PATH" value="/usr/lib/oracle/11.2/client64/lib:$LD_LIBRARY_PATH"/>

See Step 14 in << Note 1163665.1 >> for an example of how to do it.

       Configuring PHP with Oracle HTTP Server 11g (Doc ID 1163665.1)

3) Stop/Start the Webtier instance"


INSTANCE_HOME/bin/opmnctl stopall
INSTANCE_HOME/bin/opmnctl startall

4) Open a browser and try this URL:

http://hostname.domain:7777/test.php




OPTION B)

1) Make a backup copy of all the files under:

ORACLE_HOME/ohs/lib/*

2) Copy the instantclient libraries from:

INSTANT_CLIENT_HOME/client64/lib

to

ORACLE_HOME/ohs/lib

3) Ensure that the owner, group and privileges of the recently copied files match the existing ones.

4) Stop/Start the Webtier instance:


INSTANCE_HOME/bin/opmnctl stopall
INSTANCE_HOME/bin/opmnctl startall


5) Open a browser and try this URL:

http://hostname.domain:7777/test.php

Niciun comentariu:

Trimiteți un comentariu