This is a quick guide to install PHP4, MySQL4 and Apache2 in Solaris 10. In order to facilitate the management and installation of packages we will use the pkg-get tool. pkg-get is a tool to automate download and installation of binary packages, for example from Blastwave an Open Source software repository for Solaris.
Our first task will be the installation of pkg-get. At Blastwave you’ll find a complete guide on how to undertake this task. Briefly:
cd /tmp
/usr/sfw/bin/wget http://www.blastwave.org/pkg_get.pkg
pkgadd -d pkg_get.pkg all
/usr/sfw/bin/wget http://www.blastwave.org/wget-i386.bin
chmod 755 wget-i386.bin
PATH=/tmp:/opt/csw/bin:/usr/sbin:/usr/bin:
/usr/dt/bin:/usr/openwin/bin:/usr/ccs/bin
export PATH
vi /opt/csw/etc/pkg-get.conf
Pick a mirror next to you. Then:
pkg-get -i wget
PATH=/opt/csw/bin:/usr/sbin:/usr/bin:/usr/dt/bin:
/usr/openwin/bin:/usr/ccs/bin
export PATH
And now you may install other packages. But let’s focus in our target.
As Solaris 10 comes with MySQL and Apache installed by default, first we are going to uninstall them. Take a look at your system:
pkginfo | grep -i apache
system SUNWaclg Apache Common Logging
system SUNWapch2d Apache Web Server V2 Documentation
system SUNWapch2r Apache Web Server V2 (root)
system SUNWapch2u Apache Web Server V2 (usr)
system SUNWapchd Apache Web Server Documentation
system SUNWapchr Apache Web Server (root)
system SUNWapchu Apache Web Server (usr)
pkginfo | grep -i mysql
system SUNWmysqlr mysql – MySQL Database Management System (root component)
system SUNWmysqlt mysql – MySQL Database Management System (test component)
system SUNWmysqlu mysql – MySQL Database Management System (usr component)
Next task would be to uninstall these packages. Proceed as follows:
pkgrm SUNWaclg SUNWapch2d SUNWapch2r SUNWapch2u SUNWapchd SUNWapchr SUNWapchu
pkgrm SUNWmysqlr SUNWmysqlt SUNWmysqlu
Finally, install Apache, MySQL and PHP from pkg-get:
pkg-get -i apache2 mysql4 php4 mod_php
That’s all. Now configure the software as usual. Note that packages installed with pkg-get reside in /opt/csw, so I recommed adding something like this to your /etc/profile:
PATH=/opt/csw/bin:/opt/csw/mysql4/bin:$PATH
export PATH
More info:
pkg-get installation howto
pkg-get users guide
Customizing Your Working Environment