Latest Post
Compiling PHP 5.3 on Ubuntu 9.10
This guide will outline how to compile PHP 5.3 from source for use with Apache. The instructions in this guide have been tested with Ubuntu 9.10 and should work on other debian based distros. This guide is a slight modification of the video guide on setting up Apache, PHP 5.3 with xdebug, MongoDB, and Lithium created by Jon Adams. Before proceeding with the instructions below you will need Apache installed on your computer. If you do not yet have apache you can follow my guide for setting up Apache on Ubuntu 9.10.
The first step for installing PHP 5.3 is to get the prerequisites. For this guide you will need the following libraries in order to compile php with the options that I use. If you have some custom libraries/extensions that you want included in your build of PHP, now is the time to install them if you haven’t already.
The following command will install the libraries that I will need:
sudo apt-get install libmcrypt-dev libxml2 libxml2-dev libbz2-dev libcurl4-gnutls-dev libjpeg62-dbg libpng12-dev libxslt1-dev libbz2-dev
Once our required libraries have been installed we can go to http://www.php.net/downloads.php and choose to download the latest 5.3.x build in tar.gz format. I chose to copy the download link and use wget to download it to the tmp directory, but you can do whatever you like.
cd /tmp wget http://ca2.php.net/get/php-5.3.1.tar.gz/from/this/mirror
now untar the file and go into the directory
tar -xvf php-5.3.1.tar.gz cd php-5.3.1
Now comes the fun part. Here we will run the configure script that says what kind of extensions we want php built with...