Each OS X comes with PHP preinstalled but it’s usually outdated. Installing PHP from MacPorts gives you a way to have most recent version of PHP. This blog post and accompanying video tutorial will show you how to install and configure latest version of PHP and Apache.
MacPorts is a package management system that allows you to install various free and open source programs on your Mac. This blog post will take you through step by step instructions of installing MacPosrts and show you the most important commands to get you started.