Ubuntu: Installing RRDtool 1.4.5 and php->RRDtool bindings

Installing RRDtool 1.4.5:

Ubuntu 11.04 repo only offers older RRDtool 1.4.3, so if need to have a more recent RRDtool on your system:

Run the following commands as superuser:
sudo su

apt-get install libpango1.0-dev libxml2-dev

wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.4.5.tar.gz
tar -zxvf rrdtool-1.4.5.tar.gz
cd rrdtool-1.4.5

mkdir /tmp/rrdbuild
export BUILD_DIR=/tmp/rrdbuild

mkdir /opt/rrdtool-1.4.5
export INSTALL_DIR=/opt/rrdtool-1.4.5

./configure –prefix=$INSTALL_DIR ; make ; make install

RRDtool is now installed in /opt/rrdtool-1.4.5

Setting up php5-RRDtool bindings

apt-get install php5-cli php5-dev

mkdir -p /usr/local/src/php-5.3.5/ext
cd /usr/local/src/php-5.3.5/ext

wget http://oss.oetiker.ch/rrdtool/pub/contrib/php_rrdtool.tar.gz
tar -zxvf php_rrdtool.tar.gz
cd rrdtool

phpize
./configure –with-rrdtool=/opt/rrdtool-1.4.5 –with-php-config=/usr/bin/php-config
make
make install

In /etc/php5/cli/php.ini, scroll down to “Dynamic Extensions” and add this line:
extension=rrdtool.so

Make sure there’s no PHP warning or error:
php -v

To confirm module is loaded, find rrdtool from the output of:
php -m

This entry was posted in Linux, Networking. Bookmark the permalink.