Tip: if you want a newer version of apache, with no fuss, then you can use pkg-get to grab pre-compiled versions of everything you need, from OpenCSW.org !
Otherwise, if you really want to do things the hard way, and compile everything yourself, then keep reading...
I assume that you want to build PHP with SSL, berkeley "db" support, and oracle support. If you dont, then just remove the appropriate bits from the 'configure' line below.
Oracle note: It is a very odd stupidity that you have to
install the ENTIRE oracle database (eg: 'everything') to get the include
files you need for the oci8 client libraries. Or at least the ones everyone
expects, under $ORACLE_HOME/rdbms/demo.
Oddly, choosing the "developer" option from the installer, isnt enough.
Prerequisite packages: ("SFW" packages are fron Sun's "companion CD")
Check that you have the packages above, by runningSUNWapchr SUNWapchu SUNWzlib SFWbdb [or CSWbdb from opencsw.org, and adjust paths appropriately] SFWmysql [If you want extra-good mysql support. Not strictly required for php.]
If there are any missing, install "SUNW" pacakges from the sol8 CDs, and SFW packages from the "companion (freeware) CD"pkginfo SUNWapchr SUNWapchu SUNWzlib SFWbdb
This will ensure that apache wont need some long funky LD_LIBRARY_PATH set to run. Adjust the paths as appropriate for your box.export LD_RUN_PATH LD_RUN_PATH=/usr/local/ssl/lib #if you are compiling with oracle LD_RUN_PATH=$LD_RUN_PATH:`dbhome`/lib #if you are compiling with mysql LD_RUN_PATH=$LD_RUN_PATH:/opt/sfw/mysql/lib/mysql
Note for php4.2.1: If you are using gcc to compile, you will have to also do:export CC; CC=gcc
You can then configure the source build by running the following command:
IF you want the "ora_xxx" as well as the "oci_xxx" functions, add./configure --with-apxs=/usr/apache/bin/apxs \ --with-zlib=/usr --with-db3=/opt/sfw \ --with-openssl=/usr/local/ssl # ( add --with-oci8=`dbhome` for oracle ) # ( add "--with-mysql=/opt/sfw/mysql" if you have SFWmysql ) # ( add "--with-db3=/usr/local" to use SMCdb instead of SFWdb )
Once you're done with THAT, then ... follow the directions in the php INSTALL file. Pretty much just "make install", and then uncommenting the php4 lines in /etc/apache/httpd.conf
If you add in mysql, you may need to do
# (cd /opt/sfw/mysql/lib/mysql ; ln -s . .libs)because libtool is a stupid broken linux-specific piece of $H!7.
The sun "apxs" binary is slightly broken, so after doing a
install, you will have to
toLoadModule php4_module libexec/libphp4.so
LoadModule php4_module /usr/apache/libexec/libphp4.so
You will also have to uncomment the appropriate AddType line for
php in httpd.conf
AddType application/x-httpd-php .php)
# cd `dbhome` # chmod 0755 lib */public */demo
Additionally, if you want to talk to a remote oracle server (as opposed to one running on your web server), you may have to recompile php to use ODBC, from www.iodbc.org, instead of the normal Oracle client libraries. There is even a PHP-specific HOWTO document on the iodbc website.
If the oracle client libraries work for you, use them. Otherwise, try ODBC.
export LD_LIBRARY_PATH LD_LIBRARY_PATH=/usr/local/ssl/lib LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/sfw/mysql/lib/mysql LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib