Installing PHP 5.3 etc on Ubuntu Karmic (9.10)

  1. Fetch and extract the latest version of PHP.
  2. sudo apt-get build-dep php5
  3. ./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
  4. make
  5. sudo make -i install
    (-i to ignore the error about httpd.conf)
  6. sudo ln -s /etc/php5/apache2/php.ini /opt/php5.3/lib/php.ini
  7. 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
  8. Optional: install FirePHP
    sudo /opt/php5.3/bin/pear channel-discover pear.firephp.org
    sudo /opt/php5.3/bin/pear install firephp/FirePHPCore
  9. sudo apache2ctl restart