First, I'll make a /src directory in my home. Then I'll use the websites above to find the URL for the latest source file and download the tar.gz directly on the web server with wget:
wget http://us2.php.net/get/php-5.1.2.tar.gz/from/this/mirror

Create a user options file for root. This file will contain root's mysql password so he can auto log in.

su
vi ~/.my.cnf

Enter the following text into the .my.cnf file.
Change "ROOT-PWD" to the password you used for MySQL's root user.

# Add the following
# Example mysql config file.
# You can copy this to one of:
# /usr/local/mysql/etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options (in this
# installation this directory is /usr/local/mysql/var) or

# ~/.my.cnf to set user-specific options.
#
# One can use all long options that the program supports.
# Run the program with --help to get a list of available options

# This will be passed to all mysql clients
[client]
password = "ROOT-PWD"

#port = 3306
#socket = /tmp/mysql.sock
#

# Here is entries for some specific programs
# The following values assume you have at least 32M ram
#
# The MySQL server
[mysqld]
#port = 3306

chmod 700 /usr/local/etc/rc.d/apache.sh
In this lesson, we configure Apache and serve up a PHP page.

This document assumes:
•FreeBSD is installed, and you followed the instructions from part 1 of this series
•Apache 2.x and PHP 5.x are installed, and you followed the instructions from part 2 of this series.

This document also assumes that:
•at least one domain name points to your server
The one I'm using is example.com. Replace that with your domain in the references below.