Link to home
Start Free TrialLog in
Avatar of R-Byter
R-ByterFlag for Serbia

asked on

php rrdtool extension - path problem

Hello fellow experts.
I've spent unknown number of hours trying to solve this but with no luck.
Im trying to build PHP rrdtool extension following this tutorial:

http://www.samtseng.liho.tw/~samtz/blog/2009/03/11/howto-build-the-php-rrdtool-extension/

Everything goes fine until I get to the configure part. This is my response:

[root@localhost rrdtool]# ./configure --with-php-config=/usr/bin/php-config --with-rrdtool=/usr/bin
checking for egrep... grep -E
checking for a sed that does not truncate output... /bin/sed
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking whether gcc and cc understand -c and -o together... yes
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-redhat-linux-gnu
checking host system type... x86_64-redhat-linux-gnu
checking target system type... x86_64-redhat-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext
checking for PHP extension directory... /usr/lib64/php/modules
checking for PHP installed headers prefix... /usr/include/php
checking for re2c... no
configure: WARNING: You will need re2c 0.9.11 or later if you want to regenerate PHP parsers.
checking for gawk... gawk
checking for rrdtool support... yes, shared
checking if rrdtool specified path is valid... no
configure: error: The specified RRDTool path is Invalid or the installation is incomplete
      Please specify another path or reinstall the rrdtool distribution

Open in new window


Why am I getting this error and how to solve the problem?

checking if rrdtool specified path is valid... no
configure: error: The specified RRDTool path is Invalid or the installation is incomplete
      Please specify another path or reinstall the rrdtool distribution


When I try to use rrdtool just from command line it works.
Please help. :)

Thanks in advance.
Regards
Avatar of R-Byter
R-Byter
Flag of Serbia image

ASKER

When I try to reinstall it via yum i get this:

[root@localhost rrdtool]# yum install rrdtool-devel rrdtool
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * addons: centosj3.centos.org
 * base: mirror.nsc.liu.se
 * extras: centosg4.centos.org
 * rpmforge: ftp-stud.fht-esslingen.de
 * updates: centosr3.centos.org
Setting up Install Process
Package rrdtool-devel-1.4.4-1.el5.rf.x86_64 already installed and latest version
Package rrdtool-1.4.4-1.el5.rf.x86_64 already installed and latest version
Nothing to do

Open in new window


After that I try to find the location of rpm file with this:

[root@localhost rrdtool]# locate rrdtool-devel

I get nothing.
Avatar of simon3270
You might have to run "updatedb" (as root) manually to get it to find the programs.  This would normally be done as part of the install, but maybe the database needs refreshing.
Avatar of R-Byter

ASKER

Thanks, but still nothing. I took some time to finish the updatedb, but when I tried to locate rrdtool-devel rpm file I got nothing again.
There is no file in /usr/bin/ directory, the only one related to this whole thing lies here:

/var/cache/yum/dag/packages/perl-rrdtool-1.4.4-1.el5.rf.x86_64.rpm

I dont think it should be there, but I didnt move any of the files, just used yum.

I think that this file is missing, but I dont know how to correct this situation.

rrdtool-devel-1.4.4-1.el5.rf.x86_64.rpm

Those two files should be in /usr/bin if I understood this correctly.

perl-rrdtool-1.4.4-1.el5.rf.x86_64.rpm
rrdtool-devel-1.4.4-1.el5.rf.x86_64.rpm

What should I try next?

Regards
Avatar of R-Byter

ASKER

I even tried to remove rrdtool with yum remove rrdtool rrdtool-devel and it told me that he would delete the file that Im looking for, but still I cant find it. Then I installed rrdtool again with yum install rrdtool rrdtool-devel and still nothing. Attached is the screen that I got, it says installed but I cant find it. Some serious "Twilight Zone" for me.
Thanks for any help.

Regards

User generated image
I don't think we are ready to close this - there is still more work to be done!

When you install rrdtool-devel, it doesn't install any code actually called "rrdtool-devel".  I don't have 1.4.4 handy, but 1.4.3 contains:

/usr/include/rrd.h
/usr/include/rrd_client.h
/usr/include/rrd_format.h
/usr/lib64/librrd.so
/usr/lib64/librrd_th.so
/usr/lib64/pkgconfig/librrd.pc

Are any of these present on your system?
Avatar of R-Byter

ASKER

rrd.h, rrd_client.h and rrd_format.h are indeed in /usr/include folder.

In my usr/lib64 folder this is what I have related to rrd:

-rw-r--r--  1 root root   478712 Jul  9 00:05 librrd.a
lrwxrwxrwx  1 root root       15 Dec  9 00:52 librrd.so -> librrd.so.4.1.4
lrwxrwxrwx  1 root root       15 Dec  9 00:52 librrd.so.4 -> librrd.so.4.1.4
-rwxr-xr-x  1 root root   690576 Jul  9 00:05 librrd.so.4.1.4
-rw-r--r--  1 root root   476430 Jul  9 00:05 librrd_th.a
lrwxrwxrwx  1 root root       18 Dec  9 00:52 librrd_th.so -> librrd_th.so.4.1.4
lrwxrwxrwx  1 root root       18 Dec  9 00:52 librrd_th.so.4 -> librrd_th.so.4.1.4
-rwxr-xr-x  1 root root   687900 Jul  9 00:05 librrd_th.so.4.1.4

Open in new window

Avatar of R-Byter

ASKER

simon3270 wants to continue with this so I agree.
Can you post the "configure" script?  Then we can see how it is checking for the existince of rrdtool-devel.
Avatar of R-Byter

ASKER

Can You please tell me how to get it? I'm newbie at this matter.

Thanks
To add a file, I think you click the "File" entry at the bottom of the comment box, and select the file from the machine you are on.

Anyway, I have downloaded the file from http://www.samtseng.liho.tw/~samtz/blog/2009/03/11/howto-build-the-php-rrdtool-extension/, and I think the problem is the "--with-rrdtool=/usr/bin" on your configure line.  As far as I can tell, it uses the path supplied as a prefix to find /usr/include and /usr/lib, so you should instead use:

    ./configure --with-php-config=/usr/bin/php-config --with-rrdtool=/usr

(i.e. /usr, not /usr/bin).  Please give that a go and let us know what happens.
Avatar of R-Byter

ASKER

Still the same. Here is the response.

Regards

[root@localhost ~]# cd /usr/include/php/ext/rrdtool
[root@localhost rrdtool]# phpize
Configuring for:
PHP Api Version:         20041225
Zend Module Api No:      20050922
Zend Extension Api No:   220051025
[root@localhost rrdtool]# ./configure --with-php-config=/usr/bin/php-config --with-rrdtool=/usr
checking for egrep... grep -E
checking for a sed that does not truncate output... /bin/sed
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking whether gcc and cc understand -c and -o together... yes
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-redhat-linux-gnu
checking host system type... x86_64-redhat-linux-gnu
checking target system type... x86_64-redhat-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext
checking for PHP extension directory... /usr/lib64/php/modules
checking for PHP installed headers prefix... /usr/include/php
checking for re2c... no
configure: WARNING: You will need re2c 0.9.11 or later if you want to regenerate PHP parsers.
checking for gawk... gawk
checking for rrdtool support... yes, shared
checking if rrdtool specified path is valid... no
configure: error: The specified RRDTool path is Invalid or the installation is incomplete
      Please specify another path or reinstall the rrdtool distribution
[root@localhost rrdtool]#

Open in new window

OK, please try to attach the configure script.  Have it on the machine you are using to connect to Experts Exchange, rename it to configure.txt, then click on the File tag below, then "Add File", and select the configure.txt file.
Avatar of R-Byter

ASKER

I know how to attach file here, Im not sure what is configure script. Do You want me to attach what I pasted in my previous post or something else? I asked You before how to get configure script, I know how to post it.

Thanks
Ah, sorry, I misunderstood.

The configure script is the program you ran to configure the sytem - the one called "configure" (in your "./configure --with-php..." line above).  It is a shell script, and if I can look at it, I can see how it is checking whether the rrdtool-dev package has been installed.  I have looked at one of the source files used to create "configure" (which was why I asked you to try the "--with-rrdtool=/usr" fix above), but it is not entirely clear how the check is actually made in the final script.
Avatar of R-Byter

ASKER

How can I get it for You, which command do I need to run, which file to get, that is what I dont know. :)
Thanks for Your patience.
No problem.  The file is just the one called "configure" in the /usr/include/php/ext/rrdtool
 directory of the server you are building on.  If you are able to run a web browser on that machine, then rename the file (cd /usr/include/php/ext/rrdtool; mv configure configure.txt), run the browser, log in to EE, and select /usr/include/php/ext/rrdtool/configure.txt as the file to be attached to a comment.  Once it is uploaded and the message has been submitted, rename the file back (cd /usr/include/php/ext/rrdtool; mv configure.txt configure).

If you are browsing from a different machine, then you will have to copy the file from the build server to that machine - you might be able to use FTP or SCP to copy the file (if you are using Windows, there are free GUI versions of these programs available).  Once the file is on your browser machine, you can attach it to an EE comment.

If any of this is unclear, please ask again.
Avatar of R-Byter

ASKER

Everything I needed to know is how to get that configure script. :)
Here you go, its rather big, about 600KB.

Regards
configure.txt
ASKER CERTIFIED SOLUTION
Avatar of simon3270
simon3270
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of R-Byter

ASKER

This is what I have in /usr/lib regarding to rrd:

lrwxrwxrwx   1 root root      20 Dec  2 16:24 librrd.so -> /usr/lib/librrd.so.2

Its somehow written in different color. Im using Putty to access that server. Does it mean its missing or something else? By different color I mean that line have pink background color. Maybe its missing from there.
I feel we are very close to solution. Do You think I should go on, on copy all llibrrd* files from lib64 to lib?

Regards
The differnt colours are added by "ls" to show different permisisons and file types.  For example, an executable file may be in green, a non-executable file in dark blue, and a directory in light blue.

I think the pink background here is because the librrd.so entry is a symbolic link to librrd.so.2, but librrd.so.2 does not exist (as you say, "librrd.so" is the only file in /usr/lib with "rrd" in the name).  So I think you can safely delete /usr/lib/librrd.so, then copy /usr/lib64/librrd* to /usr/lib/ .
Avatar of R-Byter

ASKER

Fantastic! Configuration is finished without errors. You deserve this points. If I could only give You more of them. One more thing, how should I change configure script to have lib64 instead of lib? Do I need to replace all occurrences of $PHP_RRDTOOL/lib with $PHP_RRDTOOL/lib64?

Thanks a bunch Simon.
That would probably fix "configure", but I'm not sure it's worth it - easier to copy the files!

Hope the tool now does what you hope for!!
Avatar of R-Byter

ASKER

Yes indeed. I really appreciate your patience  and your determination to fix this even when I wanted to delete the question. Good job indeed.

Thanks again Simon.