Apache, Installing with PHP
Getting Started
I have decided to use Apache/1.x with PHP/4.x. I belive this is the better combination, as time tells, they are the most popular and better stability. Anyhow, this is my opinion, so this guide will use those two versions. There are a variety of ways to install, with distinct advantages and disadvantages:
Installing from packages
Packages are fast and easy, but do not allow you a great deal of customization. Also, it is very easy to wind up with inconsistencies between the system that a precompiled binary expects and the actual condition of your system: for example, a minor difference in the version of a particular dependency library installed may break a package, where the same difference would be handled in stride if you were compiling from source.
If you're in a hurry and have a clean system though, packages are by far the fastest way to go. First, update your ports tree and then install the packages as root:
# pkg_add -r apache13 # pkg_add -r php4
Installing from source via ports
Installing from ports will allow you to customize the build and will install from source; assuming that you've cvsup'ed recently, you'll also be using the most current version of the software. This is the recommended way to install software for most FreeBSD servers. It will also register the install with the ports db and will allow you to remove the software (via make deinstall) or upgrade (see portupgrade).
# cd /usr/ports/www/apache13