How to install PHP5, GD and OCI8 for Oracle Application Server on linux

Steps for linux 32 bits :

0.  Install rpm’s :
httpd-devel –  Development tools for the Apache HTTP server
libjpeg –  A library for manipulating JPEG image format files
libjpeg-devel –
libpng –   A library of functions for manipulating PNG image format files
libpng-devel –  Development tools for programs to manipulate PNG image format files
libXpm – libXpm runtime library
libXpm – libXpm development package
freetype – A free and portable font rendering engine
freetype-devel – FreeType development libraries and header files
php-ldap – A module for PHP applications that use LDAP.
php53-ldap – A module for PHP applications that use LDAP


ln -s /usr/lib/ /usr/lib/
ln -s /usr/lib/ /usr/lib/
ln -s /usr/lib/ /usr/lib/
ln -s /usr/lib/ /usr/lib/

1. Download PHP5 from and extract in $HOME/php5

gunzip php-5.x.x.tar.gz
tar -xvf php-5.x.x.tar


2. Download the Oracle Instant Client basic and sdk 10g from and extract in $HOME/instantclient


3. Set LD_LIBRARY_PATH to instantclient path

export LD_LIBRARY_PATH=$HOME/instantclient/instantclient_10_2


4. Export CFLAGS



5. Copy to instantclient path

cp  $ORACLE_HOME/lib/ $HOME/instantclient/instantclient_10_2


6. Create symbolic link to library

cd $HOME/instantclient/instantclient_10_2
ln -s


7. Create directory for GD images

mkdir -p $ORACLE_HOME/Apache/Apache/php/img


8. Run configure

cd $HOME/php5/php-5.3.6

./configure --prefix=$ORACLE_HOME/Apache/Apache/php --with-apxs=$ORACLE_HOME/Apache/Apache/bin/apxs --with-config-file-path=$ORACLE_HOME/Apache/Apache/conf --with-oci8=instantclient,/home/oracle/instantclient/instantclient_10_2 --disable-rpath --with-gd --with-gd2 --with-ldap --enable-sigchild --with-pic --enable-mbstring --disable-libxml --disable-dom --disable-simplexml --disable-xml --disable-xmlreader --disable-xmlwriter --without-pear --with-freetype --with-freetype-dir=$ORACLE_HOME/Apache/Apache/php/img --with-jpeg-dir=$ORACLE_HOME/Apache/Apache/php/img --with-png-dir=$ORACLE_HOME/Apache/Apache/php/img--with-xpm-dir=$ORACLE_HOME/Apache/Apache/php/img >install_log.txt


9. If ‘configure’ succeeded without any errors issue the ‘make’ command



10. If ‘make’ succeeded without any errors issue the ‘make install’ command

make install


11. Add path ‘PHPRC’ on opmn.xml to php.ini

After : <ias-component id="HTTP_Server"> <process-type id="HTTP_Server" module-id="OHS">

Add :

 <variable id="PHPRC" value="$ORACLE_HOME/Apache/Apache/conf/"/>


12. Reload opmn

opmnctl reload


13. Restart HTTP Server

opmnctl stopproc ias-component=HTTP_Server

opmnctl startproc ias-component=HTTP_Server


When starting if you have thsi error:

“Cannot load /etc/httpd/modules/ into server: cannot open shared object file: No such file or directory”

Run (32 or 64 bits):

cp -rp $ORACLE_HOME/lib/ /usr/lib/.
cp -rp $ORACLE_HOME/lib/ /usr/lib64/.


Steps for linux 64 bits :

1. Follow the same 32 bits steps 1 to 10

2. Copy the php files from 32 bits machine to 64 bits machine

copy  $ORACLE_HOME/Apache/Apache/php and  $ORACLE_HOME/Apache/Apache/libexec/

3.With ROOT user on linux 64 make symbolic links

cd /usr/lib
ln -s
ln -s

ln -s /usr/lib64/ /usr/lib/
ln -s /usr/lib64/ /usr/lib/
ln -s /usr/lib64/ /usr/lib/
ln -s /usr/lib64/ /usr/lib/

4. Follow steps 11 to 13


Good Luck !

Leave a Reply