Code

initial
[rrdtool-all.git] / contrib / php4 / INSTALL
1 $Id$
3 * Installing rrdtool module as a self-contained extension:
5 There are two ways to install the rrdtool module for php4/zend.
6 The first involves simply compiling the rrdtool module as a
7 'self-contained extension'.  This is similar to the previous
8 rrdtool module for php3 in that to use the rrd_* functions you
9 must first load the module in each script that will use the
10 rrd_* functions with a dl() call.  See the USAGE file for
11 more info on this.
13 To install as a self-contained extension:
15     1.  Install rrdtool.  (Tested with rrdtool-1.0.25)
16         Make sure you build shared and static libraries, if
17         your system lets you.  
19         rrdtool% ./configure --enable-shared
21     2.  Make sure Apache is installed.
23     3.  Make sure PHP4 is installed (tested with php-4.0.1pl2)
25     4.  Now we can build the rrdtool module.  
27         rrdtool-module% ./configure --with-rrdtool=/usr/local/rrdtool \
28                             --with-php-config=/usr/local/bin/php-config
30         'php-config' is usually installed in /usr/local/bin, and is often
31         readable/executable only by root, so you will have to run the
32         configure script as root.
34         rrdtool-module% make
35         rrdtool-module% make install
37         This should build and install 'rrdtool.so' into the correct
38         directory on your system.
40         Now you can access the rrd_* functions from your php4 scripts
41         by first calling "  dl("rrdtool.so"); ".  See the README and USAGE
42         for more info on the rrd_* functions.
45 * Installing the rrdtool module as an embedded extension
47 Installing rrdtool module as an embedded extension provides all of
48 your php4 scripts access to the rrd_* functions without having to
49 load any shared libs with the dl() function of php.  
51 In order to install the rrdtool module as an embedded extension
52 you will need to have autoconf/automake and friends installed.
54     1. make sure you have the php4 sources untarred somewhere, lets
55         call it /src/php-4.0.1pl2/
57     2. create a home for our embedded extension in the php4 source
58         tree.
60             % mkdir /src/php-4.0.1pl2/ext/rrdtool
62     3. from the rrdtool module directory, do:
64             % cp config.m4 Makefile.in php_rrdtool.h rrdtool.c \
65                 /src/php-4.0.1pl2/ext/rrdtool/
67     4. Now we must recreate the configure scripts, etc for php4.
68     
69             % cd /src/php-4.0.1pl2
70             % ./buildconf
71             
72     5. If all goes well, you should be ready to run configure for
73         php4.  Make sure you include "--with-rrdtool" in the options
74         to configure.  
76     6. make, make install.  and you're ready to go.
79 - Joe Miller, <joeym@inficad.com, joeym@ibizcorp.com>, 7/19/2000