Forum Stats

  • 3,875,295 Users
  • 2,266,907 Discussions


PHP OHS XE - Mixed Environments

jstem1177 Member Posts: 371
edited Jul 10, 2013 8:38AM in PHP

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.


  • jstem1177
    jstem1177 Member Posts: 371

    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.


  • Christopher Jones-Oracle
    Christopher Jones-Oracle Member Posts: 1,656 Employee

    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."

  • jstem1177
    jstem1177 Member Posts: 371

    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 to PHP.ini.

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

    #> rpm -ivh oracle-instantclient11.2-basic-
    #> rpm -ivh oracle-instantclient11.2-devel-
    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
    #> ./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.

This discussion has been closed.