- Fetch and extract the latest version of PHP.
sudo apt-get build-dep php5
./configure --prefix=/opt/php5.3 \
--enable-mbstring \
--enable-soap \
--enable-sqlite-utf8 \
--enable-zip \
--with-bz2 \
--with-curl \
--with-gd \
--with-gettext \
--with-gmp \
--with-ldap \
--with-openssl \
--with-xmlrpc \
--with-zlib \
--with-xsl \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-apxs2=/usr/bin/apxs2
make
sudo make -i install
(-i to ignore the error about httpd.conf)
sudo ln -s /etc/php5/apache2/php.ini /opt/php5.3/lib/php.ini
- Optional: install APC
sudo /opt/php5.3/bin/pecl install apc-beta
sudo nano /opt/php5.3/lib/php.ini
extension_dir = "/opt/php5.3/lib/php/extensions/no-debug-non-zts-20090626"
extension=apc.so
- Optional: install FirePHP
sudo /opt/php5.3/bin/pear channel-discover pear.firephp.org
sudo /opt/php5.3/bin/pear install firephp/FirePHPCore
sudo apache2ctl restart