Click to See Complete Forum and Search --> : Ignoring the ./configure flags
Morrigan
05-20-2003, 04:25 PM
We recently changed servers, and my co-worker (he's absent today) made a new clean installation of Apache, PHP, etc.
Now the problem is that I get this error:
"Call to undefined function: _()"
Which is an alias of the gettext() function. Apparently to enable it, you have to reconfigure/recompile PHP. I had never done this before so I tried. The former ./configure flags were:
./configure --with-apxs2=/usr/local/apache2/current/bin/apxs --with-mysql=/usr/local/mysql --with-zlib-dir=/usr/lib/ --enable-versioning --enable-track-vars=yes --enable-url-includes --enable-sysvshm=yes --enable-sysvsem=yes --enable-ftp --with-config-file-path=/etc
I tried to ssh into the server, go to PHP's directory, and run this again, but with the --with-gettext=/usr/local appended to it. It seemed to work, I didn't get error messages and all, but I still get the error, and the PHP info still gives me the old configuration flags.
Did I do something wrong? Maybe I'm mistaken as to how to recompile PHP...
tsinka
05-20-2003, 05:01 PM
Hi,
did you also execute 'make' and replace the old libphp4.so with the new one ? Before configuring again you should do a 'make distclean' to clean up things.
Morrigan
05-20-2003, 05:34 PM
Ah no, I didn't do that, should have thought of it... but since I didn't do the initial installation, and I'm not too familiar with this stuff, I wasn't sure if it could screw things up or not. I don't even know what that "libphp4.mo" file is :(
If I run that "make distclean" command, do I risk losing anything from the previous installation? (Granting that my ./configure command was the same as before, only with an extra flag) As in, will it affect the current php.ini file, etc?
Edit: well, I did try the "make distclean" after all, here's the output (I barely understand that stuff, heh :()
find . -name \*.lo -o -name \*.o | xargs rm -f
find . -name \*.la -o -name \*.a | xargs rm -f
find . -name \*.so | xargs rm -f
find . -name .libs -a -type d|xargs rm -rf
rm -f libphp4.la sapi/cli/php libphp4.la modules/* libs/*
rm -f config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h stamp-h php4.spec sapi/apache/libphp4.module buildmk.stamp
egrep define'.*include/php' configure|sed 's/.*>//'|xargs rm -f
find . -name Makefile | xargs rm -f
But it didn't change anything. Do I need to run a "make" again?
tsinka
05-21-2003, 02:52 AM
Hi,
after make distclean the previous compile has been cleaned up to prevent that something is cached. You now have to run configure again. Then run make, this will rebuild the libphp4.so. Just with doing a make nothing will be overwritten of your existing configuration. You can now search in the install directory for a libphp4.so (find . -name "libphp4.so"). The old libphp4.so might be in /usr/local/apache2/current/libexec. Please back it up before your overwrite it. Normally you would run make install to install the module and PEAR but in this case it should be safer and sufficient to just replace libphp4.so manually.
The hardest part of recompiling php can be situations where make fails with some errors. But since you use nearly the same configure parameters as used with the old module chances are good that everything compiles without problems. Make sure that gettext is installed before trying to compile php with gettext support.
Thomas
Morrigan
05-21-2003, 06:26 PM
Thank you for your advice. It has helped me a lot, but unfortunately not for this specific problem, lol... But it turns out I had to install some more extensions of PHP, namely GD, Imap, etc. and I understand a bit more how that stuff works now.
The thing now is, after I installed all the components (gettext, gd - which in turn needed jpeg and png, took me forever to figure out we didn't have that since ./configure gave no error messages -, imap, etc.), I made the dist-clean, then a new ./configure with all the proper flags, AND a new "make".
The make gave me a bunch of warnings, but no errors. The warnings were almost always something like this:
" warning: changing search order for system directory "/usr/local/include" ".
I then restarted Apache.
And, the php info is STILL the same. :eek:
tsinka
05-22-2003, 08:36 AM
Hi,
did you replace the libphp4.so ? You can look at your httpd.conf where apache loads the libphp4.so from.
T.
Morrigan
05-22-2003, 02:44 PM
Oh, right. I thought I did replace it, but it was the wrong file, it was indeed in the /current (I was replacing the one in /2.0.45 or something).
I replaced the file and restarted Apache, and it worked! Thanks for your help and your patience man! :)
PHP Builder
Copyright WebMediaBrands Inc. All Rights Reserved.