dario2

Member
Sep 21, 2002
12
0
151
When I run makecpphp to solve Fantastico's "Wrong datatype" warnings problem, I get the following error during the "configure" command and Cpanel's PHP doesn't get recompiled:

Code:
If configure fails try --with-freetype-dir=<DIR>
configure: error: GD build test failed. Please check the config.log for details.
!! './configure --disable-pdo --enable-ftp --enable-libxml --enable-mbstring --enable-sockets --enable-static --prefix=/var/cpanel/3rdparty/ --with-config-file-path=/usr/local/cpanel/3rdparty/etc/ --with-curl=/opt/curlssl/ --with-gd --with-gettext --with-imap=/opt/php_with_imap_client/ --with-imap-ssl=/usr --with-jpeg-dir=/usr --with-kerberos --with-libxml-dir=/opt/xml2/ --with-mcrypt=/opt/libmcrypt/ --with-mysql=/usr --with-mysql-sock=/var/lib/mysql/mysql.sock --with-openssl=/usr --with-openssl-dir=/usr --with-pgsql=/usr --with-png-dir=/usr --with-xpm-dir=/usr/X11R6 --with-zlib --with-zlib-dir=/usr' failed with exit code '256' !!
!! Verbose logfile is at '/usr/local/cpanel/logs/easy/apache/build.1228506877' !!

Done rebuilding cPanel's internal PHP.
Failed to build working PHP
When I check config.log, it says:

Code:
configure:42434: gcc -o conftest  -I/usr/kerberos/include   -lstdc++ -Wl,-rpath,/opt/xml2/lib -L/opt/xml2/lib -Wl,-rpath,/usr/kerberos/lib -L/usr/kerberos/lib -Wl,-rpath,/opt/curlssl//lib -L/opt/curlssl//lib -Wl,-rpath,/usr/X11R6/lib -L/usr/X11R6/lib conftest.c  -L   -lX11 -lXpm -lpng -lz -ljpeg -lssl -lcrypto -lcurl -lz -lssl -lcrypto -lresolv -lm -ldl -lnsl  -lxml2 -lz -lm -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lcurl -lssl -lcrypto -lldap -lz -lxml2 -lz -lm 1>&5
/usr/X11R6/lib/libXpm.so: undefined reference to `XDefaultScreen'
/usr/X11R6/lib/libXpm.so: undefined reference to `XCreateImage'
/usr/X11R6/lib/libXpm.so: undefined reference to `XDefaultVisual'
/usr/X11R6/lib/libXpm.so: undefined reference to `XFreeGC'
/usr/X11R6/lib/libXpm.so: undefined reference to `XUngrabServer'
/usr/X11R6/lib/libXpm.so: undefined reference to `XGetImage'
/usr/X11R6/lib/libXpm.so: undefined reference to `XFreeColors'
/usr/X11R6/lib/libXpm.so: undefined reference to `XParseColor'
/usr/X11R6/lib/libXpm.so: undefined reference to `XGrabServer'
/usr/X11R6/lib/libXpm.so: undefined reference to `XQueryColors'
/usr/X11R6/lib/libXpm.so: undefined reference to `XAllocColor'
/usr/X11R6/lib/libXpm.so: undefined reference to `XGetGeometry'
/usr/X11R6/lib/libXpm.so: undefined reference to `XDefaultColormap'
/usr/X11R6/lib/libXpm.so: undefined reference to `XDefaultDepth'
/usr/X11R6/lib/libXpm.so: undefined reference to `XPutImage'
/usr/X11R6/lib/libXpm.so: undefined reference to `XCreatePixmap'
/usr/X11R6/lib/libXpm.so: undefined reference to `XCreateGC'
collect2: ld returned 1 exit status
configure: failed program was:
#line 42423 "configure"
#include "confdefs.h"

    char foobar () {}
    char foobar();
    int main() {
      foobar();
      return 0;
    }
How do I solve this? Thanks!

-Dario
 

rhenderson

Well-Known Member
Apr 21, 2005
784
2
168
Oklahoma
cPanel Access Level
Root Administrator
I had that error one time, I can not remember what it said specifically, but I think you can get the error values that need to be corrected and use WHM >> Main >> Service Configuration >> PHP Configuration Editor to change those values without having to rebuild the internal PHP used by cPanel.
 

dario2

Member
Sep 21, 2002
12
0
151
Thanks, guys! I tried the installgd script as per your suggestion, but it seems the --with-gd uses PHP bundled GD library instead of the system's. So I needed to change it to --with-gd=/usr. I found it at

/var/cpanel/perl/easy/Cpanel/Easy/PHP5/GD.pm

So I modified the file, did a chattr +i on it and ran makecpphp again, and PHP compiled just fine!

-Dario