PHP won't compile!

Tarball

Verified User
Joined
Jul 21, 2007
Messages
10
I'm running php 5.2.3 with apache 2, and I've been trying to recompile php. When running ./build php_ap2, I get:

configure: error: GD build test failed. Please check the config.log for details.

*** There was an error while trying to configure php. Check the configure.php file

At the bottom of config.log is:

configure:42434: gcc -o conftest -g -O2 -Wl,-rpath,/usr/local/lib -L/usr/local/lib conftest.c -L -lfreetype -lpng -lz -ljpeg -lssl -lcrypto -lcurl -lz -lssl -lcrypto -lresolv -lm -ldl -lnsl -lxml2 -lz -lm -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lcurl -lxml2 -lz -lm 1>&5

configure: failed program was:
#line 42423 "configure"
#include "confdefs.h"

char foobar () {}
char foobar();
int main() {
foobar();
return 0;
}

Anyone know whats wrong? :confused:
 
I tried compiling the test program that was giving the error to see what was wrong.

[root@caffeine php-5.2.3]# gcc -o conftest -g -O2 -Wl,-rpath,/usr/local/lib -L/usr/local/lib conftest.c -lpng -lz -ljpeg -lssl -lcrypto -lcurl -lz -lssl -lcrypto -lresolv -lm -ldl -lnsl -lxml2 -lz -lm -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lcurl -lxml2 -lz -lm

[root@caffeine php-5.2.3]# ./conftest
./conftest: relocation error: /lib/tls/libpthread.so.0: symbol errno, version GLIBC_PRIVATE not defined in file libc.so.6 with link time reference

Anyone know what that means, or how I can fix it?
 
It looks like compiling it without -lxml2 works.

gcc -o conftest -g -O2 -Wl,-rpath,/usr/local/lib -L/usr/local/lib conftest.c -lpng -lz -ljpeg -lssl -lcrypto -lcurl -lz -lssl -lcrypto -lresolv -lm -ldl -lnsl -lz -lm -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lcurl -lz -lm

[root@caffeine customapache]# ./conftest
[root@caffeine customapache]#


I tried removing --with-xml from the php configure options, but it still tries to compile with -lxml2. I'm using CentOS 4.5 if that helps.
 
I was able to get around that error, but it still looks like something is wrong with libxml2.

Configuring extensions
checking whether to enable LIBXML support... yes
checking libxml2 install dir... no
checking for xml2-config path... /usr/local/bin/xml2-config
checking whether libxml build works... no
configure: error: build test failed. Please check the config.log for details.

I've tried using --with-libxml-dir=/usr/local/lib, but I still get that error. I've tried installing libxml2 from source, but I still get that error. I don't know what has changed, before I was able to compile php 5.2.3 with libxml2 version 2.6.16 from yum fine.
 
Well it looks like I fixed it.. For some reason I had 2 xml2-config programs. I had to set both to /usr (/path/to/xml2-config --prefix=/usr), then put --with-libxml-dir=/usr in my configure.php_ap2.
 
Now it looks like something is really messed up.. at the end of ./configure, I get

+--------------------------------------------------------------------+
| *** ATTENTION *** |
| |
| Something is likely to be messed up here, because the configure |
| script was not able to detect a simple feature on your platform. |
| This is often caused by incorrect configuration parameters. Please |
| see the file debug.log for error messages. |
| |
| If you are unable to fix this, send the file debug.log to the |
| [email protected] mailing list and include appropiate |
| information about your setup. |
+--------------------------------------------------------------------+

And make is stopping with an error:

/usr/local/directadmin/customapache/php-5.2.3/ext/mbstring/oniguruma/regerror.c: In function `onig_error_code_to_str':
/usr/local/directadmin/customapache/php-5.2.3/ext/mbstring/oniguruma/regerror.c:196: error: syntax error before "va_dcl"
/usr/local/directadmin/customapache/php-5.2.3/ext/mbstring/oniguruma/regerror.c:204:27: macro "va_start" requires 2 arguments, but only 1 given
/usr/local/directadmin/customapache/php-5.2.3/ext/mbstring/oniguruma/regerror.c:204: error: syntax error before "va_start"
/usr/local/directadmin/customapache/php-5.2.3/ext/mbstring/oniguruma/regerror.c:271: error: syntax error before "va_dcl"
/usr/local/directadmin/customapache/php-5.2.3/ext/mbstring/oniguruma/regerror.c:275: error: redefinition of parameter 's'
/usr/local/directadmin/customapache/php-5.2.3/ext/mbstring/oniguruma/regerror.c:194: error: previous definition of 's' was here
/usr/local/directadmin/customapache/php-5.2.3/ext/mbstring/oniguruma/regerror.c:279:25: macro "va_start" requires 2 arguments, but only 1 given
/usr/local/directadmin/customapache/php-5.2.3/ext/mbstring/oniguruma/regerror.c:279: error: syntax error before "va_start"
make: *** [ext/mbstring/oniguruma/regerror.lo] Error 1

Would there be anyway to clean out everything and start fresh without having to reinstall centos?
 
If you haven't tried all these steps, you might want to try them, in this order:
Code:
# cd /usr/local/directadmin/customapache/
# ./build clean
# ./build update
# ./build update
If the last above doesn't work and the errir is a missing ndbm.h file, install the bdgm-devel package. Then continue ...
Code:
./build zend
Afterwards check to make sure the proper link exists for /usr/lib/libgdbm.so; then restart apache.

Does this help?

If it does, then you can start updating to the versions you want to use.

Jeff
 
If you haven't tried all these steps, you might want to try them, in this order:
Code:
# cd /usr/local/directadmin/customapache/
# ./build clean
# ./build update
# ./build update
If the last above doesn't work and the errir is a missing ndbm.h file, install the bdgm-devel package. Then continue ...
Code:
./build zend
Afterwards check to make sure the proper link exists for /usr/lib/libgdbm.so; then restart apache.

Does this help?

If it does, then you can start updating to the versions you want to use.

Jeff
Did you mean to have ./build update twice, or was that a typo? I tried it anyway, and it didn't change anything. gdbm-devel wasn't installed, so I installed it, but that didn't seem to change anything either

Edit: I really think the problem has something to do with libxml2. I had to make some changes to the configure script to get it to get past the test before. I tried using a fresh copy of php, and I'm still getting errors at the GD test.

./conftest: relocation error: /lib/tls/libpthread.so.0: symbol errno, version GLIBC_PRIVATE not defined in file libc.so.6 with link time reference

I know libpthread is part of libxml2, does anyone know what that error means though?

Edit: I tried using PHP 5.2.2. It doesn't give a GD error, but php still gives that warning after ./configure, and now I'm getting this make error:

In file included from /usr/local/directadmin/customapache/php-5.2.2/ext/mbstring/oniguruma/regerror.c:37:
/usr/lib/gcc/i386-redhat-linux/3.4.6/include/varargs.h:4:2: #error "GCC no longer implements <varargs.h>."
/usr/lib/gcc/i386-redhat-linux/3.4.6/include/varargs.h:5:2: #error "Revise your code to use <stdarg.h>."
/usr/local/directadmin/customapache/php-5.2.2/ext/mbstring/oniguruma/regerror.c: In function `onig_error_code_to_str':
/usr/local/directadmin/customapache/php-5.2.2/ext/mbstring/oniguruma/regerror.c:196: error: syntax error before "va_dcl"
/usr/local/directadmin/customapache/php-5.2.2/ext/mbstring/oniguruma/regerror.c:202: error: syntax error before "va_list"
/usr/local/directadmin/customapache/php-5.2.2/ext/mbstring/oniguruma/regerror.c:271: error: syntax error before "va_dcl"
/usr/local/directadmin/customapache/php-5.2.2/ext/mbstring/oniguruma/regerror.c:275: error: redefinition of parameter 's'
/usr/local/directadmin/customapache/php-5.2.2/ext/mbstring/oniguruma/regerror.c:194: error: previous definition of 's' was here
/usr/local/directadmin/customapache/php-5.2.2/ext/mbstring/oniguruma/regerror.c:277: error: syntax error before "va_list"
make: *** [ext/mbstring/oniguruma/regerror.lo] Error 1

edit: 5.2.1 gives same error.
 
Last edited:
I tried 4.4.7, and it works fine, but I would really like to use php 5 :(
 
Looking at debug.log, the reason all the 5.2.x versions won't make is:

./conftest: relocation error: /lib/tls/libpthread.so.0: symbol errno, version GLIBC_PRIVATE not defined in file libc.so.6 with link time reference

This is on CentOS 4.5.. does anyone know what it means or how to fix it?
 
remove :

--with-imap=/usr/local/imap-2004g

from configure.php and compile. Not sure what the reason is; still hunting.
 
Back
Top