The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Error recompiling Cpanel's PHP

Discussion in 'General Discussion' started by dario2, Dec 5, 2008.

  1. dario2

    dario2 Member

    Joined:
    Sep 21, 2002
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    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
     
  2. rhenderson

    rhenderson Well-Known Member

    Joined:
    Apr 21, 2005
    Messages:
    785
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    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.
     
  3. stdout

    stdout Well-Known Member

    Joined:
    Apr 10, 2003
    Messages:
    189
    Likes Received:
    5
    Trophy Points:
    18
    Location:
    Nelspruit, Mpumalanga, South Africa
    cPanel Access Level:
    Root Administrator
    Just a shot in the dark here:

    Have you done a /scripts/installgd - then another /scripts/makecpphp
     
  4. dario2

    dario2 Member

    Joined:
    Sep 21, 2002
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    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
     
Loading...

Share This Page