Configure PHP With Oracle HTTP Server (OHS)

Regarding to Oracle Documentation :-

Oracle HTTP Server is the web server component in Oracle Fusion Middleware. Based on the Apache infrastructure, Oracle HTTP Server allows developers to program their site in a variety of languages and technologies.

PHP (recursive acronym for “PHP: Hypertext Preprocessor”) is a general-purpose scripting language often used for generating web sites. The object model of PHP 5 facilitates project development using standard object-oriented methodologies.

To Configure PHP with Oracle OHS Follow the below steps :-

Step #1:-

export ORACLE_HOME=/Siebel/ohs/Middleware/Oracle_WT1/
export ORACLE_INSTANCE=/Siebel/ohs/Middleware/Oracle_WT1/instances/instance1/
export CONFIG_FILE_PATH=/Siebel/ohs/Middleware/Oracle_WT1/instances/instance1/config/OHS/ohs1/

Step #2:

Download PHP From here.
Upload the file to the server ( should be on the same OHS Server).

gunzip php-5.4.27.tar.gz
tar -xvf php-5.4.27.tar
cd /Siebel/php-5.4.27

Note :-
I Used this version because older version contains bugs
conflicting types for ‘zendparse’

Step #3:-

$./configure –with-apxs2=$ORACLE_HOME/ohs/bin/apxs –prefix=$ORACLE_HOME –with-config-file-path=$CONFIG_FILE_PATH

make
make install

Don’t Run the Above command if nothing not complied successfully.
Once Complied successfully :-

libphp5.so is generated inside php/libs

Step #4:
Inside php folder 

cp php.ini-production $CONFIG_FILE_PATH/php.ini

cd $CONFIG_FILE_PATH
vi httpd.conf
add the below line:-

AddType application/x-httpd-php .php .phtml

Step #5:-
Restart OHS 

./opmnctl stopall
./opmnctl startall

Test PHP :

Install Demo Files HereExtract demo file to $CONFIG_FILE_PATH/htdocs

Using Browser :-

http://:/demo/phpinfo.php

Thank you 
Osama Mustafa
Reference :-
1- Oracle Document Here

3 thoughts on “Configure PHP With Oracle HTTP Server (OHS)

  1. Additionally export LD_LIBRARY_PATH, otherwise you will get error during configuratio:apxs:Error: Sorry, no DSO support for Apache availableExample:export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/ohs/lib:$LD_LIBRARY_PATH

    Like

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.