[rrd-developers] Re: PHP4 extension

jeff vier boinger at tradingtechnologies.com
Fri Feb 25 19:53:50 MET 2005

On Fri, 2005-02-25 at 12:55 -0500, D.Walsh wrote:
> I was unable to build a working extension with the provided files, I
> have rebuilt the config.m4 file to be compliant and now a working
> module can be built and I've verified working properly on the
> following OS's:
> FC1
> FC2
> FreeBSD 5.2
> Mac OSX 10.2.x
> Mac OSX 10.3.x
> (actually I can only test the rd_graph function because I don't have
> any PHP scripts that perform any other function calls.)
> I wanted to embed the extension into PHP and as the documentation
> explained, I moved the config.m4, rrdtool.c and php_rrdtool.h to
> php-4.3.10/ext/rrdtool, did the buildconf --force, configured PHP with
> '--with-rrdtool' and it embedded the functions in PHP as expected
> however, trying to use the embedded rrd_graph function always results
> in a 'invalid rpn expression' yet if I build PHP with
> '--with-rrdtool=shared'. it makes a shared extension and it works
> flawlessly.
> Making the functions embedded is mainly a Mac OSX preference and I
> have been extremely successful doing this with other extensions.
> I've made changes to the source files using the zlib extension
> (ext/zlib) and the xdebug extension as examples/footprints and while
> it did make the compiled code smaller, it did not make the embedded
> rrd_graph function work properly.
> I can provide root access to the server in question by ssh or through
> tightVNC (for Windows) or you can download the *nix source and build
> your own *nix cleint or you can use your own VNC client if you have
> another preference.

So, unless I'm mis-reading you, the issue can be summed up with "you
can't build it static", right?

I happen to build shared normally, but I'm running a build now to see
how it goes for me....
<time passes>
It seems to work fine, for me.

Are you running the latest rrdtool?
Here's my config:
Apache HTTPd v 2.0.53
PHP v5.0.3
RRDTool v1.0.49
and this is on Red Hat Linux ES3

And my process is this:
#(this is pseudo-scripting, obviously)
##Apache 2.0.x:
# get it, untar, cd into its directory
export CFLAGS="-march=pentium4 -mfpmath=sse -msse2 -O2 -pipe -s \
make distclean
./configure --enable-so --enable-rewrite --enable-speling \
 --disable-userdir --enable-http --enable-proxy --enable-proxy-http \
 --enable-unique-id --enable-usertrack --enable-headers \
 --enable-mime-magic --enable-mem-cache --enable-disk-cache \
 --enable-cache --enable-deflate
su -c "make install"

## PHP 4.x/5.x
# get it, untar, cd into its directory
make distclean
./configure --with-apxs2=/usr/local/apache2/bin/apxs \
 --with-mysql=shared,/usr --with-mysqli --with-gdbm --enable-dba \
 --with-flatfile --with-gd --with-zlib-dir=/usr/lib --with-readline \
 --with-snmp --enable-mbstring --with-bz2 --with-gettext --enable-bcmath
su -c "make install"

cp php.ini-recommended /usr/local/lib/php.ini  # or get another
					       # one you like
# make sure the extensions directory listed in php.ini
# (/usr/local/lib/php/extensions/no-debug-non-zts-XXXXXX) is correct

## RRDTool
# get it, untar, cd into its directory
make distclean
./configure --enable-shared
su -c "make install;make site-perl-install"
cd contrib/php4
ln -s `pwd` /usr/local/kits/source/php-x.x.x/ext/rrdtool
cd /usr/local/
ln -s rrdtool-1.0.xx rrdtool

cd /usr/local/kits/source/php-x.x.x
rm configure config.cache
export CFLAGS="-march=pentium4 -mfpmath=sse -msse2 -O2 -pipe -s \
./buildconf --force
./configure --with-apxs2=/usr/local/apache2/bin/apxs \
 --with-mysql=shared,/usr --with-mysqli --with-gdbm --enable-dba \
 --with-flatfile --with-gd --with-zlib-dir=/usr/lib \
 --with-rrdtool=/usr/local/rrdtool --with-readline --with-snmp \
 --enable-mbstring --with-bz2 --with-gettext --enable-bcmath
su -c "make install"

# make sure your php.ini is correct (make install can break it,
# apparently)

Unsubscribe mailto:rrd-developers-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-developers-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-developers
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi

More information about the rrd-developers mailing list