Here's how I installed CentOS 4.3 + Apache 2.0.52 + PHP 5.14 + Oracle 10.2 Instant Client.
1. Install CentOS 4.3, which, in my case, I opted to install everything/all packages.
2. After a successful install, become root, check for your versions of PHP & Apache:
[root@makati-gw ~]# rpm -qa | grep php
php-4.3.9-3.12
php-pgsql-4.3.9-3.12
php-mysql-4.3.9-3.12
php-imap-4.3.9-3.12
php-snmp-4.3.9-3.12
php-devel-4.3.9-3.12
php-pear-4.3.9-3.12
php-xmlrpc-4.3.9-3.12
php-ldap-4.3.9-3.12
php-gd-4.3.9-3.12
php-odbc-4.3.9-3.12
php-domxml-4.3.9-3.12
php-mbstring-4.3.9-3.12
php-ncurses-4.3.9-3.12
[root@makati-gw ~]# rpm -qa | grep httpd
httpd-suexec-2.0.52-22.ent.centos4
system-config-httpd-1.3.1-1
httpd-2.0.52-22.ent.centos4
httpd-manual-2.0.52-22.ent.centos4
httpd-devel-2.0.52-22.ent.centos4
Leave Apache where it is, as we will only replace/upgrade PHP from v 4.39 to v 5.14. Now you may try to do an`rpm -e php` but will fail since there are stuff that depend on it:
[root@makati-gw ~]# rpm -e php
error: Failed dependencies:
php = 4.3.9-3.12 is needed by (installed) php-pgsql-4.3.9-3.12.i386
php = 4.3.9-3.12 is needed by (installed) php-odbc-4.3.9-3.12.i386
php = 4.3.9-3.12 is needed by (installed) php-snmp-4.3.9-3.12.i386
php = 4.3.9-3.12 is needed by (installed) php-ldap-4.3.9-3.12.i386
php = 4.3.9-3.12 is needed by (installed) php-ncurses-4.3.9-3.12.i386
php = 4.3.9-3.12 is needed by (installed) php-pear-4.3.9-3.12.i386
php = 4.3.9-3.12 is needed by (installed) php-devel-4.3.9-3.12.i386
php = 4.3.9-3.12 is needed by (installed) php-mbstring-4.3.9-3.12.i386
php = 4.3.9-3.12 is needed by (installed) php-gd-4.3.9-3.12.i386
php = 4.3.9-3.12 is needed by (installed) php-imap-4.3.9-3.12.i386
php = 4.3.9-3.12 is needed by (installed) php-xmlrpc-4.3.9-3.12.i386
php = 4.3.9-3.12 is needed by (installed) php-mysql-4.3.9-3.12.i386
php = 4.3.9-3.12 is needed by (installed) php-domxml-4.3.9-3.12.i386
php >= 4.0.4 is needed by (installed) squirrelmail-1.4.6-5.el4.centos4.noarch
What I did was remove squirrelmail first: # rpm -e squirrelmail
Then, remove PHP: # rpm -e `rpm -qa | grep php`
3. Download the Oracle Instant Client for Linux (x86)
here. I downloaded these two items:
a)
instantclient-basic-linux32-10.2.0.2-20060331.zipb)
instantclient-sdk-linux32-10.2.0.2-20060331.zip4. Unpack these two to /opt (or wherever you desire)
5. After unpacking, cd into that directory (normally instantclient_10_2/)
6. Create the following links:
# ln -s libclntsh.so.10.1 libclntsh.so
# ln -s libocci.so.10.1 libocci.so
7. Which should give you the following:
[root@makati-gw instantclient_10_2]# ls -lha
total 96M
drwxrwxr-x 3 brent brent 4.0K May 25 22:00 .
drwxr-xr-x 4 brent brent 4.0K May 25 21:54 ..
-r--r--r-- 1 brent brent 1.6M Feb 5 13:50 classes12.jar
lrwxrwxrwx 1 brent brent 17 May 25 22:00 libclntsh.so -> libclntsh.so.10.1
-rwxrwxr-x 1 brent brent 18M Feb 5 13:50 libclntsh.so.10.1
-r-xr-xr-x 1 brent brent 5.4M Feb 5 13:50 libnnz10.so
lrwxrwxrwx 1 brent brent 15 May 25 22:00 libocci.so -> libocci.so.10.1
-rwxrwxr-x 1 brent brent 1.4M Feb 5 13:50 libocci.so.10.1
-rwxrwxr-x 1 brent brent 68M Feb 5 13:50 libociei.so
-r-xr-xr-x 1 brent brent 118K Feb 5 13:50 libocijdbc10.so
-r--r--r-- 1 brent brent 1.5M Feb 5 13:50 ojdbc14.jar
drwxrwxr-x 4 brent brent 4.0K Feb 5 13:50 sdk
8. Download PHP v 5.14 from
php.net. I got mine
here.
9. Unpack, cd into the installer's directory, then run configure with the following options:
./configure --with-apxs2=/usr/sbin/apxs --with-oci8=instantclient,/opt/instantclient_10_2
10. Run `make`, then as root, `make install`.
11. Edit /etc/httpd/conf/httpd.conf and add these:
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
12. Start apache: # service httpd start
13. Create phpinfo.php with the usual contents and put it in /var/www/html (or wherever your DocumentRoot is set). Chmod 755 phpinfo.php.
14. Open http://localhost/phpinfo.php, you should see the oci8 section where it says OCI8 Support is enabled.