Continuous integration, Hudson and PHP Setting up under Ubuntu – PART 1

Continuous Integration is a software development practice where members of a team integrate their work frequently, usually each person integrates at least daily – leading to multiple integrations per day.
Each integration is verified by an automated build (including test) to detect integration errors as quickly as possible.

In this tutorial we will try install Hudson which is a continuous integration server under Ubuntu 10.4

Install Xdebug

We will install xdebug using pear :

sudo apt-get install  php-pear

install xdebug through pecl

sudo pecl install xdebug
sudo vi /etc/php5/conf.d/xdebug.ini

Then Add


Note : find the correct generated library under /usr/lib/php5/

To test if every thing is okye type :

php --version

And you will have something like this :

php --version
PHP 5.3.2-1ubuntu4.5 with Suhosin-Patch (cli) (built: Sep 17 2010 13:41:55)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans

Installing PHPUnit

PHPUnit will be used for write unit tests :

pear channel-discover
pear channel-discover
pear install phpunit/PHPUnit

Install JAVA

sudo vi /etc/apt/sources.list


deb hardy multiverse
deb-src hardy multiverse
deb hardy-updates multiverse
deb-src hardy-updates multiverse
sudo apt-get update

sudo apt-get install sun-java6-bin

Installing Ant

sudo apt-get install ant

Installing Hudson

And finally install hudson

apt-get install daemon

wget -O /tmp/key
sudo apt-key add /tmp/key

wget -O /tmp/hudson.deb
sudo dpkg --install /tmp/hudson.deb

At this point you can test if everything is ok :


In the next tutorial i will try to explain how to install common used plugins for PHP Development and how to create build.xml the ant file configuration for common build jobs.

you can now move to part two of this tutorial :

Ressources :

3 Replies to “Continuous integration, Hudson and PHP Setting up under Ubuntu – PART 1”

  1. Thanks for sharing! Very helpful. Why i came to this page is because i installed hudson with apt-get install hudson and then number of other packages were installed like libgcj etc and then it was showing Error 500.

    It worked with your procedure above.

  2. If you are getting an error “missing phpize” while installing xdebug, try installing php5-dev before (sudo apg-get install php5-dev). Then is works…

Leave a Reply