This howto is installed and tested on:
Distributor ID: Ubuntu Description: Ubuntu 9.10 Release: 9.10 Codename: karmic ******************************************************* PHP 5.2.10-2ubuntu6.7 with Suhosin-Patch 0.9.7 (cli) (built: Jan 12 2011 17:56:07) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies ******************************************************* Linux sns 2.6.31-14-server #48-Ubuntu SMP Fri Oct 16 15:07:34 UTC 2009 x86_64 GNU/Linux
P.S ( this howto is tested and working also on Ubuntu 10.04 )
STEP 1 : install the following packages:
apt-get install rrdtool librrd-dev php5-dev gcc binutils
STEP2: Go to http://oss.oetiker.ch/rrdtool/pub/contrib/ to get the PHP rrdtool source :php_rrdtool.tar.gz
STEP 3: Extract the php_rrdtool.tar.gz file into php extensions directory(/usr/include/php5/ext/). Please use the following commands :
tar zxvf php_rrdtool.tar.gz mv rrdtool /usr/include/php5/ext/
STEP 4 : Generate configure files in order to build the PHP rrdtool. In rrdtool directory, run phpize – prepare a PHP extension for compiling. Please follow the below commands:
cd /usr/include/php5/ext/rrdtool phpize ./configure --with-php-config=/usr/bin/php-config --with-rrdtool=/usr/ make make test Build complete. make install ===================================================================== PHP : /usr/bin/php PHP_SAPI : cli PHP_VERSION : 5.3.2-1ubuntu4.7 ZEND_VERSION: 2.3.0 PHP_OS : Linux - Linux sns 2.6.35-25-server #44~lucid1-Ubuntu SMP Tue Jan 25 19:34:09 UTC 2011 x86_64 INI actual : /usr/include/php5/ext/rrdtool/tmp-php.ini More .INIs : CWD : /usr/include/php5/ext/rrdtool Extra dirs : VALGRIND : Not used ===================================================================== TIME START 2011-03-31 11:44:13 =====================================================================
Note : Make sure you have librrd.so file in library. If you don’t have that file, you can do a symbol link as bellow:
ln -s /usr/lib/librrd.so.2 /usr/lib/librrd.so
STEP 5 : Build the PHP rrdtool. Just use make and make install commands.
STEP 6 : Configure rrdtool.so in php configuration file (if you’ll use cli php rrdtool extension in /etc/php5/cli/php.ini).
joe /etc/php5/apache2/php.ini ;;;;;;;;;;;;;;;;;;;;;; ; Dynamic Extensions ; ;;;;;;;;;;;;;;;;;;;;;; ; ; If you wish to have an extension loaded automatically, use the following ; syntax: ; ; extension=modulename.extension ; extension=rrdtool.so
STEP 7: restart apache:
/etc/init.d/apache2 restart
STEP 8: Create in your DocumentRoot Directory info.php:
1
|
<?php echo phpinfo(); ? |
If everything is ok you will see :
tutorial is based on: http://www.samtseng.liho.tw/~samtz/blog/2009/03/11/howto-build-the-php-rrdtool-extension/
เพิ่มเติม>>>>http://blog.webdir.bg/install-php-rrdtool-ubuntu/
โดย Maxliner Site.