This discussion is archived
3 Replies Latest reply: Jul 10, 2013 5:38 AM by jstem1177 RSS

PHP OHS XE - Mixed Environments

jstem1177 Explorer
Currently Being Moderated

Hello All,


I was wondering if anybody has ever run into the following problem. I've got OHS and XE running on the same server, btu installed in 2 distinct ORACLE_HOME with 2 distinct users (oracle, oraweb) both part of the oinstall group.

 

I'm using the demo files and when I test using the php command line I have no problem connecting with OCI. However when I open the same file through the web I get:

 

Command line test

 

#> php -f dbtest01.php

 

 

Warning: oci_connect(): ORA-24315: illegal attribute type in /u01/app/oracle/middleware/webtier_1/instances/inst_1/config/OHS/ohs1/htdocs/demo/dbtest01.php on line 10

 

I've tried overloading http.conf with the SetEnv ORACLE_HOME to point to the XE, however I still see that the PHP environment variable _ENV["ORACLE_HOME"] still points to the OHS home.

 

Any suggestions?

 

Thanks in advance

 

Jan S.

  • 1. Re: PHP OHS XE - Mixed Environments
    jstem1177 Explorer
    Currently Being Moderated

    After going through a lot Decided to ignore the suggestion to just use $ORACLE_HOME when configuring oci if the database is local. Instead, I installed the Instant Client RPM packs.

     

    A

  • 2. Re: PHP OHS XE - Mixed Environments
    cj Employee ACE
    Currently Being Moderated

    As you found, PHP was built with a newer set of Oracle libraries than it was using at runtime.

    Regarding setting environment variables, see p78 of The Underground PHP and Oracle Manual Note the "Setting values with Apache's SetEnv directive will not work."

  • 3. Re: PHP OHS XE - Mixed Environments
    jstem1177 Explorer
    Currently Being Moderated

    Hello cj,

     

    Thanks for the note. I've gone through the book many times and there are steps that are simply unclear. I managed to get my environment working correctly after installing both the 2 rpms from oracle and not installing oci8 as an integral part of PHP but as a shared library and simply adding the extension oci8.so to PHP.ini.

     

    Also to note you must fix the APXS Mealink Note: 1163665.1

     

     

    #> rpm -ivh oracle-instantclient11.2-basic-11.2.0.3.0-1.x86_64.rpm
    #> rpm -ivh oracle-instantclient11.2-devel-11.2.0.3.0-1.x86_64.rpm
    The first RPM puts the Oracle libraries in /usr/lib/oracle/11.2/client64/lib
    The second creates headers in /usr/include/oracle/11.2/client64
    #> export ORACLE_BASE=/u01/app/oracle
    #> export ORACLE_HOME=$ORACLE_BASE/middleware/webtier_1
    #> export ORACLE_INSTANCE=$ORACLE_HOME/instances/inst_1
    #> export INSTANT_CLIENT_HOME=/usr/lib/oracle/11.2/client64
    #> export CONFIG_FILE_PATH=$ORACLE_INSTANCE/config/OHS/ohs1
    #> export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/ohs/lib:$ORACLE_HOME/opmn/lib:$LD_LIBRARY_PATH
    #> ./configure --with-apxs2=$ORACLE_HOME/ohs/bin/apxs --prefix=$ORACLE_HOME --with-config-file-path=$CONFIG_FILE_PATH --with-oci8=shared,instantclient,$INSTANT_CLIENT_HOME/lib --disable-rpath 

     

     

    Jan S.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points