Installing PHP on Linux Every modern distribution should contain PHP and PHP-compatible web server in its repositories. Note, that the repositories may not contain the most recent version of PHP.
PHP can be also compiled from the source. PHP Downloads website contains source tarballs of the most recent as well older versions of PHP.
Compilation from source requires additional libraries and build tools that may be not installed on your system. There are many guides online describing the process of compilation from source on particular distributions, therefore Google for "compiling php on YOUR_DISTRO" to find suitable guide for your distribution.
Installing PHP on Ubuntu and derivatives (like Mint) Ubuntu contains PHP in its official repositories (however, the PHP versions will be not most recent). You can easily install base PHP5 installation (PHP6 is not available at the time of writing this post) with sudo apt-get install php5 command. It will automatically install PHP5, Apache2 and all dependencies. Apache2 will be automatically configured to use PHP.
Beside basic PHP installation, you may want to install additional PHP modules. The simplest way to install them is to use some graphical package manager, like Synaptic Package Manager, to find PHP modules you want to have installed. Simply search for "php" to see the list of available packages.
The notable packages are:
php5-cli - Command-line interpreter for PHP
php5-curl - cURL support
php5-gd - Support for GD, graphics manipulation library
php5-imagick - Support for ImageMagick, another graphics manipulation library
php5-json - Support for JSON library
php5-mcrypt - Module for cryptographic features
php5-mysql - Support for MySQL
php5-sqlite - Support for SQLite
Installing PHP on Mac Todo
Looky! I'm being abducted by space aliens! Me and this tiny ad!
Two software engineers solve most of the world's problems in one K&R sized book