Page 1 of 1

Can´t use the GMP library

PostPosted: 20. October 2005 10:10
by jose
Hello!

I have XAMPP for Linux 1.4.13 (in a Red Hat Linux 9) and I need for one of my applications the GMP library. I have installed the library as they recommend in (www.swox.com/gmp) but I don´t know how to make PHP aware of this new library. Do I have to rebuilt or compile PHP again? I mean, I don´t see this library when running phpinfo(). I´ve been looking in all directories where I installed XAMPP for the configure file but I cannot find it.

I have added the /usr/local/lib to the /etc/ld.so.conf and run the program ldconfig but I get the same error when I test my application:
"Fatal error: Call to undefined function gmp_init() in /opt/lampp/htdocs/TPR_WEB/test.php on line 2
"
I have also added the /usr/local/lib path to the LD_LIBRARY_PATH environment variable, but nothing.

Any help would be really appreciate it!
Jose

PostPosted: 21. October 2005 15:41
by jose
Since I couldn´t find this configure script I decided to install a new fresh version of PHP and see what happens. But it is easier said than done. However, I think I have now installed PHP and some other libraries needed to install PHP.

Still I have problem with this GMP library because I cannot call the methods in this library, despite of I have installed it and recompile PHP with the --with-gdm flag.

Does anyone know what I am doing wrong or what I am missing?

Thanks in advance!
Jose

PostPosted: 21. October 2005 15:45
by Oswald
Dear Jose!

You need to recompile PHP completely. But that is not easy to explain and a too big story to describe in a forum entry.

You can find all used configures in /opt/lampp/share/lampp/configures.tar.gz

Many greetings and good luck
Oswald

PostPosted: 21. October 2005 16:27
by Wiedmann
Hallo Jose, Kai.

IMHO you can build this extension as shared extension also (with phpize). So, with the XAMPP devel-package, there should not be the necessity to recompile PHP again.

PostPosted: 24. October 2005 08:34
by jose
Hello!

Thank you both for helping me out. I am trying with phpize to enable this new extension but I can´t run this phpize script/program. :?

I do as follow:
>cd extname
>/opt/lampp/bin/phpize
Configuring for:
PHP Api Version: 20031224
Zend Module Api No: 20041030
Zend Extension Api No: 220040412
configure.in:63: /usr/bin/m4: ERROR: Recursion limit of 1024 exceeded, use -L<N> to change it.

I´ve been looking for info in Google, but I can´t find any solution.
Any ideas?

Thank you!
Jose

PostPosted: 25. October 2005 10:01
by jose
Hello!

Well, I fixed this problem by doing what I didn´t want to: uninstalling and installing again XAMPP.

It seemed that after all installing and uninstalling of some libraries and compilations of PHP it created dependencies or something like that, so when building PHP it complained about almost everything.

Anyway, now it is done and it works. The only thing I had to do before using phpize was setting the environment variable like this: (redhat 9)
> export PHPIZE=/opt/lampp/bin/phpize

Jose

Re: Can´t use the GMP library

PostPosted: 04. December 2010 00:36
by greno
Ok, it's five years later but this thread is my exact problem as well.

I am running XAMPP 1.6.4

I needed at add an extension for GMP. So I downloaded GMP 5.0.1 and set about to phpize it and create a GMP extension module.

# $PHPIZE
Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20060613
Zend Extension Api No: 220060519
/usr/bin/m4:configure.in:75: recursion limit of 1024 exceeded, use -L<N> to change it
autom4te: /usr/bin/m4 failed with exit status: 1

But, as you can see m4 is infinitely recursing for some reason. So elsewhere I created a whole new download of xampp-1.6.4 and xampp-devel-1.6.4 and tried again but got the exact same results with completely fresh download.

So I'm thinking maybe it's GMP 5.0.1, so I download GMP 4.2.3 and tried with it but I get the exact same error again.

Has anyone else tried this recently and successfully phpize GMP library for XAMPP?

-Gerry