 |
 | RRDtool support ? |  |
 |
 | |  |
 |
 | |  |
Joined: 14 Jul 2004 |
Posts: 4 |
Location: Stockholm |
|
 |
Posted: Mon Aug 02, 2004 5:25 am |
|
 |
 |
 |
 |
ddmitrie wrote: | yet, I have no idea how they would work together. Do you have any samples/screenshots/etc ? What kind of "including the functionality" do you mean ? Please elaborate. |
php4-rrdtool-1.03 is a project I worked on a couple of years ago. Use the login and password "demo" to see an example of how it might look.
It's merely just PHP bindings for RRDtool. Contained therein are bindings to allow you to interface php scripts with RRD tool directly via RRD tool's 'librrd' library, thus avoiding the need to use system() calls to the rrdtool binary.
This is a snippet from the INSTALL document in the php4-rrdtool archive, explaining how to install it with PHP4 - my headache comes with any attempts trying to implement it with the IDE:
INSTALL document wrote: | * Installing rrdtool module as a self-contained extension:
There are two ways to install the rrdtool module for php4/zend.
The first involves simply compiling the rrdtool module as a
'self-contained extension'. This is similar to the previous
rrdtool module for php3 in that to use the rrd_* functions you
must first load the module in each script that will use the
rrd_* functions with a dl() call. See the USAGE file for
more info on this.
To install as a self-contained extension:
1. Install rrdtool. (Tested with rrdtool-1.0.33)
Make sure you build shared and static libraries, if
your system lets you.
rrdtool% ./configure --enable-shared
2. Make sure Apache is installed.
3. Make sure PHP4 is installed (tested with php-4.0.6)
4. Now we can build the rrdtool module.
rrdtool-module% ./configure --with-rrdtool=/usr/local/rrdtool \
--with-php-config=/usr/local/bin/php-config
'php-config' is usually installed in /usr/local/bin, and is often
readable/executable only by root, so you will have to run the
configure script as root.
rrdtool-module% make
rrdtool-module% make install
This should build and install 'rrdtool.so' into the correct
directory on your system.
Now you can access the rrd_* functions from your php4 scripts
by first calling " dl("rrdtool.so"); ". See the README and USAGE
for more info on the rrd_* functions.
* Installing the rrdtool module as an embedded extension
Installing rrdtool module as an embedded extension provides all of
your php4 scripts access to the rrd_* functions without having to
load any shared libs with the dl() function of php.
In order to install the rrdtool module as an embedded extension
you will need to have autoconf/automake and friends installed.
1. make sure you have the php4 sources untarred somewhere, lets
call it /src/php-4.0.6/
2. create a home for our embedded extension in the php4 source
tree.
% mkdir /src/php-4.0.6/ext/rrdtool
3. from the rrdtool module directory, do:
% cp config.m4 Makefile.in php_rrdtool.h rrdtool.c \
/src/php-4.0.6/ext/rrdtool/
4. Now we must recreate the configure scripts, etc for php4.
% cd /src/php-4.0.6
% ./buildconf
5. If all goes well, you should be ready to run configure for
php4. Make sure you include "--with-rrdtool" in the options
to configure.
6. make, make install. and you're ready to go.
|
Just being able to do this snippet of code in the IDE would be most excellent:
Example PHP4 code wrote: |
php Header("Content-type: image/gif");
$opts = ....;
$f = tempnam("/tmp","rrd");
$ret = rrd_graph($f, $opts, count($opts));
readfile($f);
unlink($f);
|
At this moment, I am unable to test any code involving the RRDtool functionality this extension provides, unless I actually upload it to a server that has this module loaded - which kinda partially kills the point of the IDE for my sake. :-/
-- Hans.
PS,
Main site for RRDtool is available at http://www.caida.org/Tools/RRDtool
|
_________________ -- Hans.
|
 |
 | |  |
 |
 | |  |
 |
 | |  |
Site Admin
Joined: 13 Jul 2003 |
Posts: 8355 |
|
|
 |
Posted: Tue Aug 03, 2004 7:16 am |
|
 |
 |
 |
 |
PHPED is a client tool while PHP EXTENSION is a server side module. I'm confused a bit  )
If you meant you want to use an extension for your development in php, you can do it. PhpED can run locally installed php (what so ever is pointed out in tools->settings->SRV web server) or remotely installed one (what so ever is pointed out in URL project property). Depending on that you can install your very own php extension into appropriate location. Also your success on this way depends on if you have this extension for the OS/platform  ))
|
|
 |
 | |  |
Joined: 14 Jul 2004 |
Posts: 4 |
Location: Stockholm |
|
 |
Posted: Wed Aug 04, 2004 5:52 am |
|
 |
 |
 |
 |
ddmitrie wrote: | PHPED is a client tool while PHP EXTENSION is a server side module. I'm confused a bit )
If you meant you want to use an extension for your development in php, you can do it. PhpED can run locally installed php (what so ever is pointed out in tools->settings->SRV web server) or remotely installed one (what so ever is pointed out in URL project property). Depending on that you can install your very own php extension into appropriate location. Also your success on this way depends on if you have this extension for the OS/platform )) |
Ah! Okey, now I am jumping up and down, being happy - but one thing hits me like a brick wall. I dont have any tools what so ever to even attempt to get this extension to work under Windows.
Is this something that you at NuSphere can take care of (URL at the top), and include it for download somewhere? I can imagine that there are several customers besides myself who would be more than happy to have this function..
Best regards,
-- Hans.
|
_________________ -- Hans.
|
 |
 | |  |
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
All times are GMT - 5 Hours
Page 1 of 1
|
|
|
|  |