20.6.09

PHP5 RRD Module in Ubuntu/Debian Lenny missing!

Today, I started reading about using RRDTool in replacement for the flash-based reports that I was using for a pet project. What stunned me later was to finding out that php bindings for this nifty little tool is absent in my toolkit!

I am here now to tell you how I did it, well, sort of, :D

1.) be sure to download http://oss.oetiker.ch/rrdtool/pub/contrib/php_rrdtool.tar.gz
2.) apt-get (or I use aptitude in ubuntu) install librrd-dev php5-dev
3.) extract php_rrdtool.tar.gz (tar zxvf php_rrdtool.tar.gz
4.) enter the directory created by extraction then run phpize
5.) run ./configure then make to compile the module
6.) inside the created modules directory lies two files: rrdtool.so and rrdtool.la. copy both files to your extension_dir (which you can find out if you open the php.ini that is being called by your apache web server) I saved mine in /usr/lib/php5/20060613+lfs which is the default for debian lenny
7.) add this line:
extension=rrdtool.so
in any of your php.ini file (in debian lenny's or ubuntu's case, you can create a new .ini file in /etc/php5/apache2/conf.d and put that line in there )
8.) restart your apache webserver
9.) create a phpinfo(); file and see if these lines exists:
rrdtool
rrdtool Version 1.2.x extension
rrdtool support enabled

10.) you're done!