Building PHP4 for FreeBSD

FreeBSD ships with mod_php4 as a precompiled binary package, however it does not include all of the optional PHP components I need. Most of these extra modules are there because they are required by IMP. Here is the process I follow when building PHP4.

Collect Dependancy Packages

The optional features of PHP require various libraries to be installed on the system. If you attempt to build PHP4 from the ports collection, it will try to download and compile all of these libraries. This is a real Pandora's Box, because not only does it take a while to build these, but those libraries have other dependancies, and before you know it, you will be compiling X.

To simplify all this, I locate the dependancy libraries and install those as precompiled packages. Here is a list of the packages that claim to be dependancies of mod_php4 on my system:

/usr/ports/www/mod_php4

The first time you do a make in this directory, you will be prompted to select all of the options you want built into PHP4. These are the optional components that I use:

[X] GD          GD library support
[X] zlib        zlib library support
[X] mcrypt      Encryption support
[X] IMAP        IMAP support
[X] IMAP-SSL    IMAP-SSL support (implies IMAP)
[X] MySQL       MySQL database support
[X] PostgreSQL  PostgreSQL database support
[X] OpenSSL     OpenSSL support
[X] XML         XML support
[X] FTP         File Transfer Protocol support
[X] CURL	CURL support
[X] gettext     gettext library support