Page 1 of 1

PHP Compile help please

Posted: Sun Jun 18, 2006 5:42 pm
by Doctor_Cox
Hi everyone,

I'm trying to recompile PHP 4.4.2 under Fedora Core 2 on my Plesk 7.5.4 installation, as I need to add full GD2 support, Mcrypt, XSLT as well as an additional library for handling credit card transactions with our bank. I'm running tests on an offline server configured identically to the online one.

I updated the PHP installation using yum and atomicrocketturtle.com before attempting recompile. After running configure, I got the following error....
checking whether IMAP works... no
configure: error: build test failed. Please check the
config.log for details.
I tried all sorts of different IMAP service names, but I cannot seem to pin down the exact IMAP service it refers to. Numerous web searches have been no help. Here is the configure directives I'm using, copied almost direct from the PHP install. I had to remove a couple of specific paths like --with-mcrypt=shared as it was saying it couldn't find mcrypt.h
--host=i686-redhat-linux-gnu --build=i686-redhat-linux-gnu --target=i386-redhat-linux --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info --cache-file=../config.cache --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --enable-force-cgi-redirect --disable-debug --enable-pic --disable-rpath --enable-inline-optimization --with-bz2 --with-db4=/usr --with-curl --with-exec-dir=/usr/bin --with-freetype-dir=/usr --with-png-dir=/usr --with-gd --enable-gd-native-ttf --without-gdbm --with-gettext --with-ncurses --with-gmp --with-iconv --with-jpeg-dir=/usr --with-openssl --with-png --with-pspell --with-regex=system --with-xml --with-expat-dir=/usr --with-dom=shared,/usr --with-dom-xslt=/usr --with-dom-exslt=/usr --with-xmlrpc=shared --with-pcre-regex --with-zlib --with-layout=GNU --enable-bcmath --enable-exif --enable-ftp --enable-magic-quotes --enable-safe-mode --enable-sockets --enable-sysvsem --enable-sysvshm --enable-track-vars --enable-trans-sid --enable-yp --enable-wddx --with-pear=/usr/share/pear --with-imap=shared --with-imap-ssl --with-kerberos --with-ldap=shared --with-mysql=shared,/usr --with-mhash=shared --with-mcrypt --enable-xslt=shared --with-xslt-sablot --with-sablot-js=/usr --with-pgsql=shared --with-snmp=shared,/usr --with-snmp=shared --enable-ucd-snmp-hack --with-unixODBC=shared,/usr --enable-memory-limit --enable-bcmath --enable-shmop --enable-calendar --enable-dbx --enable-dio --enable-mcal --enable-mbstring=shared --enable-mbstr-enc-trans --enable-mbregex --enable-force-cgi-redirect
Here is the - I think - relevant bits of config.log...
configure:44252: checking for IMAP support
configure:44298: checking for IMAP Kerberos support
configure:44323: checking for IMAP SSL support
configure:44701:31: /usr/include/mail.h: No such file or directory
configure:44722:21: imap4r1.h: No such file or directory
configure:44822: checking for pam_start in -lpam
configure:44841: gcc -o conftest -g -O2 -L/usr/lib -Wl,-rpath,/usr/kerberos/lib -L/usr/kerberos/lib conftest.c -lpam -lgmp -lfreetype -lpng -lz -ljpeg -ldb-4.2 -ldb-4.2 -lcurl -lbz2 -lz -lresolv -lm -ldl -lnsl -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto -lgssapi_krb5 -lkrb5 -lcom_err -lk5crypto -lresolv -ldl -lz -lcurl -lssl -lcrypto -lgssapi_krb5 -lkrb5 -lcom_err -lk5crypto -lresolv -ldl -lz -lssl -lcrypto -lssl -lcrypto -lgssapi_krb5 -lkrb5 -lcom_err -lk5crypto -lresolv -ldl -lz -lz 1>&5
configure:44979: checking for crypt in -lcrypt
configure:44998: gcc -o conftest -g -O2 -L/usr/lib -Wl,-rpath,/usr/kerberos/lib -L/usr/kerberos/lib conftest.c -lcrypt -lgmp -lfreetype -lpng -lz -ljpeg -ldb-4.2 -ldb-4.2 -lcurl -lbz2 -lz -lresolv -lm -ldl -lnsl -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto -lgssapi_krb5 -lkrb5 -lcom_err -lk5crypto -lresolv -ldl -lz -lcurl -lssl -lcrypto -lgssapi_krb5 -lkrb5 -lcom_err -lk5crypto -lresolv -ldl -lz -lssl -lcrypto -lssl -lcrypto -lgssapi_krb5 -lkrb5 -lcom_err -lk5crypto -lresolv -ldl -lz -lz 1>&5
configure:46267: gcc -o conftest -g -O2 -L/usr/lib -Wl,-rpath,/usr/kerberos/lib -L/usr/kerberos/lib conftest.c -Wl,-rpath,/usr/kerberos/lib -L/usr/kerberos/lib -lc-client -lcrypt -lpam -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto -lgssapi_krb5 -lkrb5 -lcom_err -lk5crypto -lresolv -ldl -lz -lgmp -lfreetype -lpng -lz -ljpeg -ldb-4.2 -ldb-4.2 -lcurl -lbz2 -lz -lresolv -lm -ldl -lnsl -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto -lgssapi_krb5 -lkrb5 -lcom_err -lk5crypto -lresolv -ldl -lz -lcurl -lssl -lcrypto -lgssapi_krb5 -lkrb5 -lcom_err -lk5crypto -lresolv -ldl -lz -lssl -lcrypto -lssl -lcrypto -lgssapi_krb5 -lkrb5 -lcom_err -lk5crypto -lresolv -ldl -lz -lz 1>&5
/usr/bin/ld: cannot find -lc-client
collect2: ld returned 1 exit status
configure: failed program was:
#line 46242 "configure"
#include "confdefs.h"

void mm_log(void){}
void mm_dlog(void){}
void mm_flags(void){}
void mm_fatal(void){}
void mm_critical(void){}
void mm_nocritical(void){}
void mm_notify(void){}
void mm_login(void){}
void mm_diskerror(void){}
void mm_status(void){}
void mm_lsub(void){}
void mm_list(void){}
void mm_exists(void){}
void mm_searched(void){}
void mm_expunged(void){}
char auth_gssapi_valid();
int main() {
auth_gssapi_valid();
return 0;
}

configure:46293: checking whether IMAP works
configure:46326: gcc -o conftest -g -O2 -L/usr/lib -Wl,-rpath,/usr/kerberos/lib -L/usr/kerberos/lib conftest.c -Wl,-rpath,/usr/kerberos/lib -L/usr/kerberos/lib -lc-client -lcrypt -lpam -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto -lgssapi_krb5 -lkrb5 -lcom_err -lk5crypto -lresolv -ldl -lz -lgmp -lfreetype -lpng -lz -ljpeg -ldb-4.2 -ldb-4.2 -lcurl -lbz2 -lz -lresolv -lm -ldl -lnsl -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto -lgssapi_krb5 -lkrb5 -lcom_err -lk5crypto -lresolv -ldl -lz -lcurl -lssl -lcrypto -lgssapi_krb5 -lkrb5 -lcom_err -lk5crypto -lresolv -ldl -lz -lssl -lcrypto -lssl -lcrypto -lgssapi_krb5 -lkrb5 -lcom_err -lk5crypto -lresolv -ldl -lz -lz 1>&5
/usr/bin/ld: cannot find -lc-client
collect2: ld returned 1 exit status
configure: failed program was:
#line 46301 "configure"
#include "confdefs.h"

void mm_log(void){}
void mm_dlog(void){}
void mm_flags(void){}
void mm_fatal(void){}
void mm_critical(void){}
void mm_nocritical(void){}
void mm_notify(void){}
void mm_login(void){}
void mm_diskerror(void){}
void mm_status(void){}
void mm_lsub(void){}
void mm_list(void){}
void mm_exists(void){}
void mm_searched(void){}
void mm_expunged(void){}
char mail_newbody();
int main() {
mail_newbody();
return 0;
}
Any insight much appreciated. While I have computer experience dating back many years including some C programing, this is my first time trying to recompile something on Linux.

Posted: Mon Jun 19, 2006 8:26 am
by koor
Why don't you rebuild the rpm ?
Its way easier and makes sure that you have the correct libs.

Posted: Mon Jun 19, 2006 9:16 am
by scott
Welcome to my world :P

Posted: Mon Jun 19, 2006 5:01 pm
by Doctor_Cox
koor wrote:Why don't you rebuild the rpm ?
Its way easier and makes sure that you have the correct libs.
May I again reiterate the fact that I am a complete noob when it comes to Linux? :) I've been thrown into this mess by my boss, with no previous knowledge whatsoever. I've been using computers for 14 years, including some programming, but it's with DOS, Windows and Macs. What little I know about installing RPMs and using things like Yum I've learned on the fly over the last couple of months.

So if someone could point me in the right direction of the best and easiest way to do the recompile with the options I need, either with instructions or maybe a link to a good tutorial, it would be much appreciated.

Posted: Tue Jun 20, 2006 7:30 am
by breun
The php packages in this archive have GD2 support builtin (make sure you have the gd package installed). Using the regular OS packages you may need to install the php-gd.

Mcrypt and XSLT support can be added by running yum install php-mcrypt php-xslt.

Posted: Wed Jun 21, 2006 6:47 pm
by Doctor_Cox
The real problem with the compile appears to be the missing IMAP service (apparently UW-IMAP) not running.

Posted: Thu Jun 22, 2006 3:41 am
by koor
It looks more like a missing development lib.
Try installing imap-dev package.

Posted: Thu Jun 29, 2006 7:35 pm
by Doctor_Cox
Thanks guys. Both your ideas worked. I was able to do the recompile after installing imap-devel, but as it turns out yumming those two packages was all that was needed. I don't really understand it, especially since I swear I tried that, but hey, whatever works :D