This is what I did to install Apache 2.2.12 and PHP 5.3.0 on Solaris 9 (SPARC/Sun-Fire-V490). I chose an application user (applusr) to install Apache as I did not require to launch it on a reserved port (1-1024). Installation instructions could differ for you depending on how Solaris 9 was installed on your host (available packages).

(4) Set the PATH variable correctly, so that binaries like gcc (typically in /usr/local/bin) and make (typically in /usr/ccs/bin) can be accessed. For example, my PATH is /bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/ccs/bin

(5) Compile and Build Apache (I used a non-root user and specified where I want to install Apache with the –prefix option):

# Unpack and extract the apache source
gunzip httpd-2.2.12.tar.gz
tar xvf httpd-2.2.12.tar
cd httpd-2.2.12
# Compile and build the apache source
# The –enable-so option is used to load the mod_so module at compile time in order
# to enable DSO Support for shared modules like PHP, mod_proxy, etc.).
# For illustration, apache will be installed in /webserver/apache-2.2.12
./configure --prefix=/webserver/apache-2.2.12 --enable-so
make
make install

(6) Install PHP (I used a non-root user and specified where I want to install PHP with the –prefix option)