Whenever you compile from source code it is necessary to have Xcode installed. It's a free download from Apple Developer Connection.
The following installation is configured with the same commands as the Apple shipped module for TIGER.
To check what is your current php version via terminal: php -v
curl -O http://us2.php.net/distributions/php-5.2.5.tar.gz gunzip php-5.2.5.tar.gz tar -xvf php-5.2.5.tar
Create install script OS X Server: (see below if you're installing on Tiger Client)
cat > php5.Build #! /bin/sh ./configure \ --prefix=/usr/local/php5 \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --with-apxs \ --with-ldap=/usr \ --with-kerberos=/usr \ --enable-cli \ --with-zlib-dir=/usr \ --enable-trans-sid \ --with-xml \ --enable-exif \ --enable-ftp \ --enable-mbstring \ --enable-mbregex \ --enable-dbx \ --enable-sockets \ --with-iodbc=/usr \ --with-config-file-path=/etc \ --sysconfdir=/private/etc \ --with-mysql=/usr \ --with-mysql-sock=/var/mysql/mysql.sock
Do a "control C" to end the "cat >" process. That will create a file called php.Build in your home directory.
chmod 775 php5.Build cd php-5.2.5 ../php5.Build make sudo make install sudo apachectl graceful restart
PHP.INI (php pref file)
/etc/php.ini.default - If you need to use the pref file rename "php.ini.default" to "php.ini" and it should be available to you.