You are on page 1of 2

Apache, MySql and PHP Howto (from source)

 Data and Technology

Posted on April 29th, 2005

Written by cliff

Related Posts

o Things to remember when creating Apache SSL certs

o Horde / IMP on RHEL 4 From RPM HOWTO
o Installing OpenGroupWare 1.1.5 on RHEL 3


apache, linux, mysql, php, solaris

Everyone loves web applications that use Apache, PHP and MySQL, and everyone loves
having their very own web servere that runs them. The problem is, how do you do it? If
your’re like me, you don’t do it enough to remember, so here are some quick directions to
get you started.

First we must download the latest versions of Apache, MySQL and PHP and extract
them. You may have to dig a little since these places are always changing where they
keep things, but the links below should be of some use. Just make sure you download the
source distribution.

MySQL Download >

Apache Download >
PHP Download >

I always put these applications in /usr/local/server, but you can select whatever location
you like. Simply add whatever directory you want into the –prefix directive.
First, let’s build and install MySQL

# cd /path/to/mysql/source/directory
# ./configure –prefix=/usr/local/server/mysql
# make
# make install

Next, we have to build and install the Apache web server. In this example, we are
building it with SSL, URL Rewrite and Shared Object support.

# cd /path/to/apache/source/directory
# ./configure –prefix=/usr/local/server/apache –enable-module=so –enable-rewrite -
# make
# make install

Finally, build and install PHP. There are lots of things you can include when building
PHP, but these are the most common.

# ./configure –with-apxs2=/usr/local/server/apache/bin/apxs –with-

mysql=/usr/local/server/mysql –enable-debug=no –enable-track-vars=yes –enable-
bcmath=yes –enable-memory-limit=yes –with-imap –with-ldap=/usr/local/server/ldap –
enable-ftp –with-gd –with-jpeg-dir=/usr/local –with-png-dir=/usr/local –with-zlib-
# make
# make install

That should do it… If everything went well, you can start up your fancy new apache web

# /usr/local/server/apache/bin/apachectl start