PHP-RRDTool installation on CentOS 5

Step-1 Adding Yum Repository

Add the Reporforge repository. Then-

Yum install php-rrdtool

Alternatively, you can download the rpm from

http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/php-rrdtool-1.4.4-1.el5.rf.i386.rpm

Step-2 : Configure rrdtool.so in php configuration file.

# cd /etc/php.d/
# vi rrdtool.ini
; Enable rrdtool extension module
extension=rrdtool.so

Next Restart apache web services.

# service httpd restart

Step-3 Checking php-rrd module is working fine

You need to have PHP compiled with RRDTool support to run the following PHP examples. If you compile PHP by hand then see: how to build the php rrdtool extension by hand. If you are using a distribution's pre-compiled PHP binary you should be able to install a second package with RRDTool support. You can verify that your PHP install is ready to go by running this:

<?php
phpinfo(INFO_MODULES);
?>

Then search for "rrdtool" in the output and make sure that "rrdtool support" is enabled.

While going through each of the following steps you will notice that each call takes a couple of parameters and then one parameter that is just a string of options. The string of options is exactly how it is for generating/updating/graphing RRDs from the command line. This makes for a consistent interface for the different languages that have RRDTool support.

Src:

http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/

http://repoforge.org/use/

http://sam.liho.tw/2009/03/11/howto-build-the-php-rrdtool-extension/

http://www.ioncannon.net/system-administration/59/php-rrdtool-tutorial/

How to build the PHP rrdtool extension by hand

Share