View Full Version : Php & Imap
Hi,
I'm thinking of recompiling PHP to include, for example, the IMAP modules.
Has onyone done this (and succeeded)?
I've got a few Ensim servers, and recompiling PHP on those boxes it kinda hard; especially since after that most upgrades won't work any more. :-(
Any ideas on this issue?
Tino
l0rdphi1
01-09-2004, 06:37 AM
The DA customapache script does this very easily for you.
Check out /usr/local/directadmin/customapache
./build and ./configure.php
These files appear to be holding the info I need.
But I really would like some info on how to modify these. (For example; what do the version numbers do?)
I could simply add the required --with-imap=/usr/local/imap-2000e to the compile statement in configure.php;
'./configure' '--with-apxs' '--with-curl' '--with-curl-dir=/usr/local/lib' '--with-gd' '--with-gd-dir=/usr/local/lib' '--with-gettext' '--with-jpeg-dir=/usr/local/lib' '--with-kerberos' '--with-mcrypt' '--with-mysql' '--with-pear' '--with-png-dir=/usr/local/lib' '--with-xml' '--with-zlib' '--with-zlib-dir=/usr/local/lib' '--enable-bcmath' '--enable-calendar' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-track-vars'
Would this be sufficient? Do I recompile PHP simply by running ./configure.php?
Sould I compile and install c-client and imap-2000e before running configure.php?
(There are some issues with the imap-2000e install, you should not copy the imap files to the system include directory, since there may be conflicts. See www.php.net, and search for IMAP in the functions list for more info.)
thanks!
Tino
Okay, I did it.
This is what I did;
I downloaded the c-client and installed it. Since I'm on a RH9 box, this is the make command for the c-client:
make lrh EXTRACFLAGS=-I/usr/kerberos/include EXTRALDFLAGS=-I/usr/kerberos/lib
I've create a directory /usr/local/imap-2000e and created a /lib and /include directory in it.
I copied all files to the proper directory (including c-client.a to lib/libc-client.a)
I change the compile options in configure.php. I added:
--with-imap=/usr/local/imap-2000e
Then I did a ./build php without rebuilding everything that was already on the system.
Then I restarted apache, just to be safe. :-)
That did the trick!
I hope IMAP won't be disabled in future updates....
Thanks for the info!
Tino
Icheb
01-09-2004, 08:23 AM
Originally posted by tino
I change the compile options in configure.php. I added:
--with-imap=/usr/local/imap-2000e
Then I did a ./build php without rebuilding everything that was already on the system.
Then I restarted apache, just to be safe. :-)
That did the trick!
I hope IMAP won't be disabled in future updates....
Thanks for the info!
Tino
Well, Personally i recommend to backup the configure.php and apache files, because when there is a new version everyone starts trying what someone else has posted on the forums without knowing what the rm configure.php exactly does, at least, i said something about it before :D
DirectAdmin doesn't automatically recompile apache or php (or any hosting related stuff besides itsself, as far as i know), only when installing new modules it tends to use the rpm command (or does it accually compile ?)
Every time the custombuilder is used you need to restart apache to get the new stuff to work.
DirectAdmin Support
01-09-2004, 10:56 AM
Hello,
DirectAdmin doen't touch that stuff once installed :) And yes, all apache related things are compiled.
John
uk_joker2003
01-14-2004, 03:46 PM
anychance of an idiots guide to this? Where did you get c-client? etc etc
Thanks in advance
Hi,
Yes, I can give you a small "HOWTO":
1) Download the c-client: ftp://ftp.cac.washington.edu/imap/c-client.tar.Z in a directory of your liking, for example your home directory. I will assume you download the file in you current directory.
2) Extract the c-client: tar -zxvf c-client.tar.Z
3) Enter the c-client source directory: cd imap-2002e (Of course, the directory name can vary if you extracted the client to another directory, or a new release comes available. At this moment 2002e is the latest stable version, but there is a 2004 beta.)
4) Check the file Makefile to see how you should "Make" the c-client. (Look in Makefile and find your system type code. For example, modern versions of Linux will use either "slx", "lnp", "lrh", or "lsu".)
5) "Make" the c-client, for example: make slx
NOTE: If you run RedHat 9, use this command:
make lrh EXTRACFLAGS=-I/usr/kerberos/include EXTRALDFLAGS=-I/usr/kerberos/lib
6) It's important that you do not copy the IMAP source files directly into the system include directory as there may be conflicts. Instead, create a new directory inside the system include directory, such as /usr/local/imap-2000e/ (location and name depend on your setup and IMAP version), and inside this new directory create additional directories named lib/ and include/. From the c-client directory from your IMAP source tree, copy all the *.h files into include/ and all the *.c files into lib/. Additionally when you compiled IMAP, a file named c-client.a was created. Also put this in the lib/ directory but rename it as libc-client.a.
7) Change the configure.php in /usr/local/directadmin/customapache. Add this line:
--with-imap=/usr/local/imap-2000e
at the end of the configure statement. Remember to add a "\" to the previous line. The configure statement should look like this:
./configure \
--with-apxs \
--with-curl \
--with-curl-dir=/usr/local/lib \
--with-gd \
--with-gd-dir=/usr/local/lib \
--with-gettext \
--with-jpeg-dir=/usr/local/lib \
--with-kerberos \
--with-mcrypt \
--with-mysql \
--with-pear \
--with-png-dir=/usr/local/lib \
--with-xml \
--with-zlib \
--with-zlib-dir=/usr/local/lib \
--enable-bcmath \
--enable-calendar \
--enable-ftp \
--enable-magic-quotes \
--enable-sockets \
--enable-track-vars \
--with-imap=/usr/local/imap-2000e
It is at the top of the configure.php file.
8) Recompile PHP. Go to /usr/local/directadmin/customapache and type: ./build php Do not rebuild the stuff that PHP uses; it's allready on your system and doesn't need recompiling.
9) Restart the Apache Web Server (from the DirectAdmin Control Panel, or /etc/init.d/httpd restart).
I know that this could be done nicer if you place the entire process of installing the c-client to your server in the build file. But since you have to do some copying and renaming in the c-client libraries (see point 6) I did it the way I mentioned above.
Well, this small HOWTO should enable everyone to install IMAP support in PHP.
You can use the phpinfo() command to see if it all worked.
And euh... Don't blame me if you brake your server. :-) Should be pretty safe though!
Tino
uk_joker2003
01-15-2004, 07:01 AM
I am now getting this when i build php
Thank you for using PHP.
/usr/local/directadmin/customapache/configure.php: line 19: --enable-bcmath: command not found
*** There was an error while trying to configure php. Check the configure.php file
I guess you added the --with-imap=/usr/local/imap-2000e line below the other "--with..." lines?
Did you terminate that new line with a "\" (like the rest)?
it should read:
--with-imap=/usr/local/imap-2000e \
All lines in the configure statement should end with "\", except the last one.
Tino
uk_joker2003
01-15-2004, 07:13 AM
below is my configure.php
#!/bin/sh
./configure \
--with-apxs \
--with-curl \
--with-curl-dir=/usr/local/lib \
--with-gd \
--with-gd-dir=/usr/local/lib \
--with-gettext \
--with-jpeg-dir=/usr/local/lib \
--with-kerberos \
--with-mcrypt \
--with-mysql \
--with-pear \
--with-png-dir=/usr/local/lib \
--with-xml \
--with-zlib \
--with-zlib-dir=/usr/local/lib \
--enable-bcmath \
--enable-calendar \
--enable-ftp \
--enable-magic-quotes \
--enable-sockets \
--enable-track-vars \
--with-imap=/usr/local/imap-2000e \
loopforever
01-15-2004, 07:15 AM
Change
--with-imap=/usr/local/imap-2000e \
to
--with-imap=/usr/local/imap-2000e
That should fix your problem. By keeping \ at the end, the configure script is going to think there's another flag coming after --with-imap.
uk_joker2003
01-15-2004, 07:17 AM
i then get the below
Thank you for using PHP.
/usr/local/directadmin/customapache/configure.php: line 19: --enable-bcmath: command not found
/usr/local/directadmin/customapache/configure.php: line 24: --with-imap=/usr/local/imap-2000e: No such file or directory
*** There was an error while trying to configure php. Check the configure.php file
It seems you did not install the c-client in the directory you mention in the configure.php script.
Did you correctly copy the c-client files?
Tino
uk_joker2003
01-15-2004, 07:36 AM
this is my complete customapache\configure.php file
#!/bin/sh
./configure \
--with-apxs \
--with-curl \
--with-curl-dir=/usr/local/lib \
--with-gd \
--with-gd-dir=/usr/local/lib \
--with-gettext \
--with-jpeg-dir=/usr/local/lib \
--with-kerberos \
--with-mcrypt \
--with-mysql \
--with-pear \
--with-png-dir=/usr/local/lib \
--with-xml \
--with-zlib \
--with-zlib-dir=/usr/local/lib \
--enable-bcmath \
--enable-calendar \
--enable-ftp \
--enable-magic-quotes \
--enable-sockets \
--enable-track-vars \
--with-imap=/usr/local/imap-2000e
/usr/local/imap-2000e contains only the 2 directorys
/include and /lib
both of which are listed below
LIB
auth_gss.c ckp_pam.c flockcyg.c kerb_mit.c memmove.c os_a41.c os_do4.c os_s40.c rename.c strtoul.c
auth_log.c ckp_pmb.c flocksim.c koi8_r.c memset.c os_aix.c os_drs.c os_sc5.c rfc822.c tcp_unix.c
auth_md5.c ckp_psx.c flstring.c koi8_u.c mh.c os_aos.c os_dyn.c os_sco.c scandir.c tenex.c
auth_pla.c ckp_sec.c fs_unix.c ksc_5601.c misc.c os_art.c os_hpp.c os_sgi.c setpgrp.c tis_620.c
auths.c ckp_ssn.c fsync.c libc-client.a mmdf.c os_asv.c os_isc.c os_shp.c sig_bsd.c truncate.c
big5.c ckp_std.c ftl_unix.c linkage.c mtx.c os_aux.c os_lnx.c os_slx.c siglocal.c tz_bsd.c
ckp_1st.c ckp_sv4.c gb_12345.c log_bsi.c mx.c os_bsd.c os_lyn.c os_sol.c sig_psx.c tz_nul.c
ckp_2nd.c ckp_svo.c gb_2312.c log_cyg.c netmsg.c os_bsf.c os_mct.c os_sos.c sig_sv4.c tz_sv4.c
ckp_3rd.c ckp_ult.c gethstid.c log_old.c news.c os_bsi.c os_mnt.c os_sun.c smanager.c unix.c
ckp_a41.c cns11643.c gr_wait4.c log_os4.c newsrc.c os_cvx.c os_nto.c os_sv2.c smtp.c utf8.c
ckp_afs.c crexcl.c gr_wait.c log_sec.c nfstest.c os_cyg.c os_nxt.c os_sv4.c ssl_none.c utime.c
ckp_bsi.c crx_nfs.c gr_waitp.c log_std.c nfstnew.c osdepbas.c os_os4.c os_ult.c sslstdio.c viscii.c
ckp_cyg.c crx_std.c ibm.c log_sv4.c nfstold.c osdep.c os_osf.c os_vu2.c ssl_unix.c windows.c
ckp_dce.c dummy.c imap4r1.c mail.c nl_unix.c osdepckp.c os_osx.c phile.c strerror.c write.c
ckp_gss.c env_unix.c iso_8859.c mbox.c nntp.c osdeplog.c os_ptx.c pmatch.c strpbrk.c
ckp_nul.c fdstring.c jis_0208.c mbx.c opendir.c osdepssl.c os_pyr.c pop3.c strstr.c
ckp_os4.c flcksafe.c jis_0212.c memmove2.c os_a32.c os_d-g.c os_qnx.c pseudo.c strtok.c
INCLUDE
c-client.h flstring.h mbx.h news.h os_aos.h os_cvx.h os_hpp.h os_nxt.h os_s40.h os_sos.h pop3.h tenex.h
dummy.h fs.h mh.h newsrc.h os_art.h os_cyg.h os_isc.h os_os4.h os_sc5.h os_sun.h pseudo.h unix.h
env.h ftl.h misc.h nl.h os_asv.h osdep.h os_lnx.h os_osf.h os_sco.h os_sv2.h rfc822.h utf8.h
env_unix.h imap4r1.h mmdf.h nntp.h os_aux.h os_d-g.h os_lyn.h os_osx.h os_sgi.h os_sv4.h smtp.h
fdstring.h linkage.h mtx.h os_a32.h os_bsd.h os_do4.h os_mct.h os_ptx.h os_shp.h os_ult.h sslio.h
flockcyg.h mail.h mx.h os_a41.h os_bsf.h os_drs.h os_mnt.h os_pyr.h os_slx.h os_vu2.h tcp.h
flocksim.h mbox.h netmsg.h os_aix.h os_bsi.h os_dyn.h os_nto.h os_qnx.h os_sol.h phile.h tcp_unix.h
Hmm... That all looks pretty okay to me.
I have no clue what goes wrong.
If you remove the "--with-imap" line from the configure.php script, are you able to recompile php then?
Tino
uk_joker2003
01-15-2004, 07:46 AM
thanks for your help if i change it back i still get this error
/usr/local/directadmin/customapache/configure.php: line 19: --enable-bcmath: command not found
*** There was an error while trying to configure php. Check the configure.php file
I think you need to get this one sorted out first.
Since bcmatch doesn't need to be compiled or anything (it's just a PHP option) the real error might be the line above.
Could it be you have used a "strange" editor? Open the file in vi and see if there are any strange characters at the end of the previous line... I'm not sure if that is the problem, but I really would have no other idea.
Tino
uk_joker2003
01-15-2004, 08:01 AM
I used vi and i have just checked it with pico and there are no extra charachers...
uk_joker2003
01-15-2004, 08:16 AM
how do i do a clean install of php?
The configure script does just that. :-)
It configures the PHP installation, a make and a make install after that will install PHP.
The build script will do all that for you.
Tino
uk_joker2003
01-15-2004, 08:47 AM
is it worth saying yes and over writing everything? By the way my php seems to still work
DirectAdmin Support
01-15-2004, 11:47 AM
cd /usr/local/directadmin/customapache
./build clean
./build php
If you want to restore the defaut configure.php file, run:
cd /usr/local/directadmin/customapache
rm -f configure.*
./build clean
./build update
./build php
John
uk_joker2003,
How did it all work out? Did you get a clean install of PHP? And did you manage to add imap support in PHP?
You can also add --with-imap-ssl to the ./configure line of PHP... I forgot to mention that earlier.
TIno
Quick IMAP into PHP guide:
Get the imap* RPM's from one of the RedHat 9 mirrors if you run redhat 9.., next set of commands should work:
rpm -Uvh ftp://ftp.nluug.nl/site/ftp.redhat.com/redhat/linux/9/en/os/i386/RedHat/RPMS/imap*
cd /usr/local/directadmin/customapache
rm -f configure.php
./build clean
./build update
Open up the freshly downloaded configure.php, and modify the last part:
add a \ to the last line and then add imap:
--enable-track-vars \
--with-imap
Save that file, then do:
./build php
Answer yes to all rebuild questions to make sure you're up to date on all packages, then once it finishes do a: service httpd restart
You should have imap support then.., quick way to check:
create a file in /var/www/html/ called phpinfo.php with the following lines:
<?php
phpinfo();
?>
Then go to: http://you.ip.address/phpinfo.php
And you should be able to see the freshly compiled IMAP with that info..
Good luck :-)
Wunk
worked perfect. Thanks!
Eagle1
03-09-2004, 07:15 PM
I have tried both of these and keep getting
checking whether IMAP works... no
configure: error: build test failed. Please check the config.log for details.
*** There was an error while trying to configure php. Check the configure.php file
If I take the --with-imap out of the configure.php file, it will work. But I need IMAP.
What do I need to do, to fix this?
Thanks, Eddie
Looks like you're still missing the IMAP libraries..
Eagle1
03-10-2004, 11:38 AM
When I tried to install the rpm's, I was informed they were already installed.
I tried again adding --force to insure they were installed.
Eddie
What's in the config.log ?
Eagle1
03-12-2004, 12:39 AM
I can't find a config.log.
Eagle1
03-12-2004, 12:55 AM
I found it. It was in the php-4.3.4 directory.
Do you know why it's not working?
Thanks, Eddie
Could you try the following:
Type in a bash command line:
export LANG=en_US
And then recompile in that same shell ?
(do a './build clean' first, then a './build update', put the changes in the config.php again for imap, then a './build php', might even want to remove the php-4.3.4 source directory)
There's a bug in the plain RH9 release of bash, which has a weird language setting, and it messes up a certain range of compiles (Perl's CPAN completely breaks if you try to compile something in a plain RH9 setup without updates)
Dunno if this causes it, but it's worth a shot..
Sounds like some libraries or header files are missing. After making imap, did you correctly copy the required header files and libraries to the correct location?
Tino
Eagle1
03-15-2004, 06:00 AM
Originally posted by Wunk
There's a bug in the plain RH9 release of bash, which has a weird language setting, and it messes up a certain range of compiles (Perl's CPAN completely breaks if you try to compile something in a plain RH9 setup without updates)
Dunno if this causes it, but it's worth a shot..
Ok, thanks. I'll give it a shot tonight!
Eagle1
03-15-2004, 08:44 PM
I have tried all of the above. I still can't get it to work.
I must be missing something.
Is there some sort of up2date command to get any missing libraries?
Luke Skidmore
04-06-2004, 10:29 PM
I compiled using the command tino gave for redhat 9, but after I did I had no c-client.a file creted that I could copy.
So I am stuck and I don't know how to proceed from here.
TIA
DirectAdmin Support
04-08-2004, 09:58 AM
Hello,
Modified imap source code can be found here:
http://files.directadmin.com/services/imapback.tar.gz
It should create the c-client.a for you.
John
ctnchris
06-25-2004, 08:48 PM
I tried to use it using up2date imap then running the configure, but It tells me it cant find "rfc822.h."
Quick google:
http://rpm.pbone.net/index.php3/stat/4/idpl/367127/com/maildrop-devel-1.4.0-2rph.i586.rpm.html
Provides :
maildrop-devel
Content of RPM :
/usr/include/rfc2045.h
/usr/include/rfc2047.h
/usr/include/rfc822.h
/usr/lib/librfc2045.a
/usr/lib/librfc822.a
/usr/share/man/man3/rfc2045.3.bz2
/usr/share/man/man3/rfc822.3.bz2
ProWebUK
06-27-2004, 10:31 AM
Originally posted by ctnchris
I tried to use it using up2date imap then running the configure, but It tells me it cant find "rfc822.h."
rpm -e imapd
cd /usr/local/directadmin/scripts/
./imapd.sh
Chris
DirectAdmin Support
06-27-2004, 01:04 PM
Hello,
Just a note that the imapd binary we've included isn't standard because it required changes to accomodate the virtual pop accounts. Using up2date might install another one that won't work with these email accounts.
The rfc822.h header that is used with the build of our imapd binary is found in the c-clients directory of the http://files.directadmin.com/services/imapback.tar.gz
file, after it's built (use ./buildit)
John
ctnchris
10-28-2004, 09:43 AM
Originally posted by tino
Lots of info on compiling php with imap Thanks, that worked perfectly :D
KacangPutih
02-17-2005, 10:04 PM
I am using imap-2004c1, and it is in Fedora Core 3.
When i try to compile php with imap i got the followin error
/usr/bin/ld: Warning: size of symbol `hash_reset' changed from 94 in /usr/lib/mysql/libmysqlclient.a(hash.o) to 89 in /usr/local/imap-2004c1/lib/libc-client.a(misc.o)
Any idea?
Thanks.
jlasman
02-18-2005, 09:26 AM
Warnings should not stop the compile.
Does the resulting program work?
Jeff
existenz
03-16-2005, 09:53 AM
Has anyone made this work for FreeBSD? I have been tring for months to get this to work on one of our boxes.
When you compile php with imap extensions this is the errors the the config.log. I REALLY appreciate any help!
configure:40064: checking for IMAP support
configure:40513: checking for pam_start in -lpam
configure:40532: gcc -o conftest -g -O2 -R/usr/local/lib -L/usr/local/lib conftest.c -lpam -lintl -lpng -lz -ljpeg -lcurl -lz -
configure:40670: checking for crypt in -lcrypt
configure:40689: gcc -o conftest -g -O2 -R/usr/local/lib -L/usr/local/lib conftest.c -lcrypt -lpam -lintl -lpng -lz -ljpeg -lcu
configure:41120: checking whether SSL libraries are needed for c-client
configure:41250: gcc -o conftest -g -O2 -R/usr/local/lib -L/usr/local/lib -R/usr/local/imap-2004/lib -L/usr/local/imap-2004/lib
/usr/bin/ld: cannot find -lgssapi_krb5
configure: failed program was:
#line 41225 "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:41276: checking whether IMAP works
configure:41309: gcc -o conftest -g -O2 -R/usr/local/lib -L/usr/local/lib -R/usr/local/imap-2004/lib -L/usr/local/imap-2004/lib
/usr/bin/ld: cannot find -lgssapi_krb5
configure: failed program was:
#line 41284 "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;
}
inetworx
03-29-2005, 09:35 AM
Originally posted by DirectAdmin Support
Hello,
Just a note that the imapd binary we've included isn't standard because it required changes to accomodate the virtual pop accounts. Using up2date might install another one that won't work with these email accounts.
The rfc822.h header that is used with the build of our imapd binary is found in the c-clients directory of the http://files.directadmin.com/services/imapback.tar.gz
file, after it's built (use ./buildit)
John
Can't get it build... ./buildit gives a error Unknown command in my RH9
inetworx
04-02-2005, 03:46 AM
Originally posted by DirectAdmin Support
Hello,
Just a note that the imapd binary we've included isn't standard because it required changes to accomodate the virtual pop accounts. Using up2date might install another one that won't work with these email accounts.
The rfc822.h header that is used with the build of our imapd binary is found in the c-clients directory of the http://files.directadmin.com/services/imapback.tar.gz
file, after it's built (use ./buildit)
John
Can you please write the proper procedure how to install IMAP php for RH9. I can't get it done. A Lot of errors.
If someone has a step by step instruction for me!?
I tried every methode witch is writen in this topic but still IMAP doen't work.
Group-Office installation
Configuration tests
PHP version: Ok (4.3.10)
MySQL support: Ok
IMAP support: Warning: IMAP extension not installed, E-mail module will not work.
Iconv support: Warning: iconv extension not installed, E-mail module will be unreliable with character encodings.
File upload support: Ok
drmike
04-28-2005, 06:46 PM
What make type do we use for CentOS 3.4? I don't see it listed here.
-drmike
tklaver
05-01-2005, 08:47 AM
Small update maybe for usage with Fedora 2.
Commands have an # in front.
# wget ftp://ftp.cac.washington.edu/imap/c-client.tar.Z
# tar -zxvf c-client.tar.Z
Version may differ on date used
# cd imap-2004d/
# make lrh EXTRACFLAGS=-I/usr/kerberos/include EXTRALDFLAGS=-I/usr/kerberos/lib
Create directories.
Version may differ on date used
# mkdir /usr/local/imap-2004d
Create libraries dir
# mkdir /usr/local/imap-2004d/lib
Create include dir
# mkdir /usr/local/imap-2004d/include
Change dir into the c-client dir.
# cd c-client/
Copy all .h files into /usr/local/imap-2004d/include/
# cp *.h /usr/local/imap-2004d/include/
Copy all .c files.
# cp *.c /usr/local/imap-2004d/lib/
Copy c-client.a
# cp c-client.a /usr/local/imap-2004d/lib/libc-client.a
Change the configure file of php.
# pico /usr/local/directadmin/customapache/configure.php
Add:
\
--with-imap=/usr/local/imap-2004d
Where \ is on the end of the last line in the file before you started changing it.
# /usr/local/directadmin/customapache/build php
We are not recompiling other things besides php, so we said no to all questions.
After everything is finished, restart apache.
# service httpd restart
To check if the recompile worked properly, create a file called phpinfo.php, with the following content:
phpinfo.php
<?php
phpinfo();
?>
Surf to http://www.yourcompany.com/phpinfo.php and verify if the following information is there:
IMAP c-Client Version 2004
If so, the installation went fine.
This might be working on all RedHat based operating systems, but this is nor confirmed nor certain. I'm not responsible for any errors
Mikej0h
05-15-2005, 02:35 PM
Hi all,
I'm also trying to get this to work. Trying to suit on CentOS 4.0 with uptodate DirectAdmin.
During compiling the imap-2004d directory it just failes.
If you have any suggestions, please tell me !
Here the complete action log (and see by yourself where it failes):
wget ftp://ftp.cac.washington.edu/imap/c-client.tar.Z
tar -xvzf c-client.tar.Z
[... extract all files ...]
cd imap-2004d/
Then tried two make options, but both failes:
make slx AND make lrh
[... sorry for the long code...]
make sslnopwd
make[1]: Entering directory `/root/imap-2004d'
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Building in full compliance with RFC 3501 security
+ requirements:
++ TLS/SSL encryption is supported
++ Unencrypted plaintext passwords are prohibited
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
make[1]: Leaving directory `/root/imap-2004d'
Applying an process to sources...
tools/an "ln -s" src/c-client c-client
tools/an "ln -s" src/ansilib c-client
tools/an "ln -s" src/charset c-client
tools/an "ln -s" src/osdep/unix c-client
tools/an "ln -s" src/mtest mtest
tools/an "ln -s" src/ipopd ipopd
tools/an "ln -s" src/imapd imapd
tools/an "ln -s" src/mailutil mailutil
tools/an "ln -s" src/mlock mlock
tools/an "ln -s" src/dmail dmail
tools/an "ln -s" src/tmail tmail
ln -s tools/an .
make build EXTRACFLAGS='' EXTRALDFLAGS='' EXTRADRIVERS='mbox' EXTRAAUTHENTICATORS=''
PASSWDTYPE=std SSLTYPE=nopwd IP=4 EXTRASPECIALS='' BUILDTYPE=lnp \
SPECIALS="GSSDIR=/usr/kerberos SSLDIR=/usr/share/ssl
SSLINCLUDE=/usr/include/openssl SSLLIB=/usr/lib LOCKPGM=/usr/sbin/mlock" \
EXTRACFLAGS=" -I/usr/kerberos/include"
make[1]: Entering directory `/root/imap-2004d'
Building c-client for lnp...
echo `cat SPECIALS` > c-client/SPECIALS
cd c-client;make lnp EXTRACFLAGS='-I/usr/kerberos/include'\
EXTRALDFLAGS=''\
EXTRADRIVERS='mbox'\
EXTRAAUTHENTICATORS=''\
PASSWDTYPE=std SSLTYPE=nopwd IP=4\
GSSDIR=/usr/kerberos SSLDIR=/usr/share/ssl
SSLINCLUDE=/usr/include/openssl SSLLIB=/usr/lib LOCKPGM=/usr/sbin/mlock
make[2]: Entering directory `/root/imap-2004d/c-client'
make build EXTRACFLAGS='-I/usr/kerberos/include' EXTRALDFLAGS='' EXTRADRIVERS='mbox' EXTRAAUTHENTICATORS=''
PASSWDTYPE=std SSLTYPE=nopwd IP=4 `cat SPECIALS` OS=lnx \
SIGTYPE=psx CHECKPW=pam CRXTYPE=nfs \
SPOOLDIR=/var/spool \
ACTIVEFILE=/var/lib/news/active \
RSHPATH=/usr/bin/rsh \
BASECFLAGS="-g -fno-omit-frame-pointer -O2" \
BASELDFLAGS="-lpam -ldl"
make[3]: Entering directory `/root/imap-2004d/c-client'
sh -c 'rm -rf auths.c crexcl.c nfstest.c linkage.[ch] siglocal.c osdep*.[ch] *.o
ARCHIVE *FLAGS *TYPE c-client.a || true'
Once-only environment setup...
echo cc > CCTYPE
echo -g -fno-omit-frame-pointer -O2 '-I/usr/kerberos/include' > CFLAGS
echo -DCREATEPROTO=unixproto -DEMPTYPROTO=unixproto \
-DMAILSPOOL=\"/var/spool/mail\" \
-DANONYMOUSHOME=\"/var/spool/mail/anonymous\" \
-DACTIVEFILE=\"/var/lib/news/active\" -DNEWSSPOOL=\"/var/spool/news\" \
-DRSHPATH=\"/usr/bin/rsh\" -DLOCKPGM=\"/usr/sbin/mlock\" > OSCFLAGS
echo -lpam -ldl > LDFLAGS
echo "ar rc c-client.a osdep.o mail.o misc.o newsrc.o smanager.o utf8.o siglocal.o dummy.o pseudo.o
netmsg.o flstring.o fdstring.o rfc822.o nntp.o smtp.o imap4r1.o pop3.o
unix.o mbx.o mmdf.o tenex.o mtx.o news.o phile.o mh.o mx.o;ranlib c-client.a" > ARCHIVE
echo lnx > OSTYPE
./drivers mbox imap nntp pop3 mh mx mbx tenex mtx mmdf unix news phile dummy
./mkauths md5 pla log
make[4]: Entering directory `/root/imap-2004d/c-client'
echo -DMD5ENABLE=\"/etc/cram-md5.pwd\" >> OSCFLAGS
make[4]: Leaving directory `/root/imap-2004d/c-client'
ln -s os_lnx.h osdep.h
ln -s os_lnx.c osdepbas.c
ln -s log_std.c osdeplog.c
ln -s sig_psx.c siglocal.c
ln -s crx_nfs.c crexcl.c
ln -s ip4_unix.c ip_unix.c
sh -c '(test -f /usr/include/sys/statvfs.h -a lnx != sc5 -a lnx != sco) && ln -s
nfstnew.c nfstest.c || ln -s nfstold.c nfstest.c'
Standard password authentication
ln -s ckp_pam.c osdepckp.c
Building with SSL
ln -s ssl_unix.c osdepssl.c
echo -I/usr/include/openssl -I/usr/include/openssl/openssl
-DSSL_CERT_DIRECTORY=\"/usr/share/ssl/certs\"
-DSSL_KEY_DIRECTORY=\"/usr/share/ssl/certs\" >> OSCFLAGS
echo " ssl_onceonlyinit ();" >> linkage.c
echo -L/usr/lib -lssl -lcrypto >> LDFLAGS
Building with SSL and plaintext passwords disabled unless SSL/TLS
echo " mail_parameters (NIL,SET_DISABLEPLAINTEXT,(void *) 2);" >> linkage.c
cat osdepbas.c osdepckp.c osdeplog.c osdepssl.c > osdep.c
Building OS-dependent module
If you get No such file error messages for files x509.h, ssl.h,
pem.h, buffer.h, bio.h, and crypto.h, that means that OpenSSL
is not installed on your system. Either install OpenSSL first
or build with command: make lnx SSLTYPE=none
`cat CCTYPE` -c `cat CFLAGS` `cat OSCFLAGS` -c osdep.c
osdep.c:71:31: security/pam_appl.h: No such file or directory
osdep.c:88: warning: `struct pam_response' declared inside parameter list
osdep.c:88: warning: its scope is only this definition or declaration, which is probably not what you want
osdep.c:88: warning: `struct pam_message' declared inside parameter list
osdep.c: In function `checkpw_conv':
osdep.c:92: sizeof applied to an incomplete type
osdep.c:93: dereferencing pointer to incomplete type
osdep.c:94: `PAM_PROMPT_ECHO_ON' undeclared (first use in this function)
osdep.c:94: (Each undeclared identifier is reported only once
osdep.c:94: for each function it appears in.)
osdep.c:95: invalid use of undefined type `struct pam_response'
osdep.c:95: dereferencing pointer to incomplete type
osdep.c:95: `PAM_SUCCESS' undeclared (first use in this function)
osdep.c:96: invalid use of undefined type `struct pam_response'
osdep.c:96: dereferencing pointer to incomplete type
osdep.c:98: `PAM_PROMPT_ECHO_OFF' undeclared (first use in this function)
osdep.c:99: invalid use of undefined type `struct pam_response'
osdep.c:99: dereferencing pointer to incomplete type
osdep.c:100: invalid use of undefined type `struct pam_response'
osdep.c:100: dereferencing pointer to incomplete type
osdep.c:102: `PAM_TEXT_INFO' undeclared (first use in this function)
osdep.c:103: `PAM_ERROR_MSG' undeclared (first use in this function)
osdep.c:104: invalid use of undefined type `struct pam_response'
osdep.c:104: dereferencing pointer to incomplete type
osdep.c:105: invalid use of undefined type `struct pam_response'
osdep.c:105: dereferencing pointer to incomplete type
osdep.c:109: `PAM_CONV_ERR' undeclared (first use in this function)
osdep.c: At top level:
osdep.c:120: syntax error before '*' token
osdep.c: In function `checkpw_cleanup':
osdep.c:125: `hdl' undeclared (first use in this function)
osdep.c:125: `PAM_DELETE_CRED' undeclared (first use in this function)
osdep.c:126: `PAM_SUCCESS' undeclared (first use in this function)
osdep.c: In function `checkpw':
osdep.c:137: `pam_handle_t' undeclared (first use in this function)
osdep.c:137: `hdl' undeclared (first use in this function)
osdep.c:138: storage size of `conv' isn't known
osdep.c:145: `PAM_SUCCESS' undeclared (first use in this function)
osdep.c:146: `PAM_RHOST' undeclared (first use in this function)
osdep.c:149: `PAM_ESTABLISH_CRED' undeclared (first use in this function)
osdep.c:151: `PAM_DELETE_CRED' undeclared (first use in this function)
osdep.c:152: `PAM_AUTH_ERR' undeclared (first use in this function)
make[3]: *** [osdep.o] Error 1
make[3]: Leaving directory `/root/imap-2004d/c-client'
make[2]: *** [lnp] Error 2
make[2]: Leaving directory `/root/imap-2004d/c-client'
make[1]: *** [OSTYPE] Error 2
make[1]: Leaving directory `/root/imap-2004d'
make: *** [lrh] Error 2
ballyn
05-15-2005, 05:34 PM
Originally posted by Mikej0h
`cat CFLAGS` `cat OSCFLAGS` -c osdep.c
osdep.c:71:31: security/pam_appl.h: No such file or directory
pam_appl.h is included in the pam-devel package in RH3, probably the same for RH/Centos4.
Mikej0h
05-16-2005, 06:46 AM
Thanks, downloading and installing the pam-devel package was the solution to this problem.
By the way my os is CentOS 3.4 instead of CentOS 4.0.
Thanks anyway !
costarica
07-26-2005, 07:08 PM
I am not sure what I am doing wrong... I followed the instructions for imap-2004e given earlier in this thread, copying everything to the /usr/local/imap-2004e 'lib' and 'include' dirs.
Then modified the configure.php and added:
/
--with-imap=/usr/local/imap-2004e
Running ./build php returns this error:
checking for IMAP support... yes
checking for IMAP Kerberos support... yes
checking for IMAP SSL support... no
checking for pam_start in -lpam... yes
checking for crypt in -lcrypt... (cached) yes
configure: error: Cannot find rfc822.h. Please check your c-client installation.
*** There was an error while trying to configure php. Check the configure.php file
Any ideas? I checked and rfc822.h IS located in the imap-2004e/include dir.
Mikej0h
07-27-2005, 01:25 AM
Originally posted by costarica
I am not sure what I am doing wrong... I followed the instructions for imap-2004e given earlier in this thread, copying everything to the /usr/local/imap-2004e 'lib' and 'include' dirs.
Then modified the configure.php and added:
/
--with-imap=/usr/local/imap-2004e
Running ./build php returns this error:
Any ideas? I checked and rfc822.h IS located in the imap-2004e/include dir.
Try this: http://www.directadmin.com/forum/showthread.php?threadid=1640&perpage=20&pagenumber=2
Scroll down...
--with-imap should suffice..
Make sure to also have installed imap-devel-*
What to do?
checking for iconv support... no
checking for IMAP support... yes
checking for IMAP Kerberos support... yes
checking for IMAP SSL support... no
checking for pam_start in -lpam... yes
checking for crypt in -lcrypt... yes
configure: error: Kerberos libraries not found.
Check the path given to --with-kerberos (if no path is given, searches in /usr/kerberos, /usr/local and /usr )
*** There was an error while trying to configure php. Check the configure.php file
costarica
07-27-2005, 02:31 PM
Awesome, that did the trick.
I was trying to recompile PHP% w/imap support, but when I followed the instructions and just used the included version of php4, it worked.
So, no php5 for me for now since I need imap support, which is fine since I also need jpgraph and it was not working right on php5 anyhow.
Thanks agian guys!
ManageMyService
09-16-2005, 03:22 PM
Just thought i'd also update this thread to mention that teh following works on 4.3.10 -
cd /home
mkdir build
cd build
wget http://files.directadmin.com/services/imapback.tar.gz
tar -zxvf imapback.tar.gz
cd imap-2002e
./buildit
cd c-client
make slx EXTRACFLAGS=-I/usr/kerberos/include EXTRALDFLAGS=-I/usr/kerberos/lib
mkdir /usr/local/imap-2000e/
mkdir /usr/local/imap-2000e/lib
mkdir /usr/local/imap-2000e/include
cp *.h /usr/local/imap-2000e/include
cp *.c /usr/local/imap-2000e/lib
cp c-client.a /usr/local/imap-2000e/lib
mv /usr/local/imap-2000e/lib/c-client.a /usr/local/imap-2000e/lib/libc-client.a
cd /usr/local/directadmin/customapache
nano -w configure.php (Add --with-imap=/usr/local/imap-2000e \ to php config)
./build php (answer n to all questions)
But on 4.3.11 this no longer works and needs further investigation.
What exactly is happening?
Nice how-to tino!
I've one question before I continue executing it. Step 5 in your how-to:
Originally posted by tino
5) "Make" the c-client, for example: make slx
NOTE: If you run RedHat 9, use this command:
make lrh EXTRACFLAGS=-I/usr/kerberos/include EXTRALDFLAGS=-I/usr/kerberos/lib
I'm on a debian 3.1 system, after reading the Makefile, I suppose I have to do # make ldb
But I'm not sure, maybe to include some extra parameters? Does anyone knows sure how to do this for Debian?
rocky
12-18-2005, 06:01 AM
Originally posted by ManageMyService
Just thought i'd also update this thread to mention that teh following works on 4.3.10 -
cd /home
mkdir build
cd build
wget http://files.directadmin.com/services/imapback.tar.gz
tar -zxvf imapback.tar.gz
cd imap-2002e
./buildit
cd c-client
make slx EXTRACFLAGS=-I/usr/kerberos/include EXTRALDFLAGS=-I/usr/kerberos/lib
mkdir /usr/local/imap-2000e/
mkdir /usr/local/imap-2000e/lib
mkdir /usr/local/imap-2000e/include
cp *.h /usr/local/imap-2000e/include
cp *.c /usr/local/imap-2000e/lib
cp c-client.a /usr/local/imap-2000e/lib
mv /usr/local/imap-2000e/lib/c-client.a /usr/local/imap-2000e/lib/libc-client.a
cd /usr/local/directadmin/customapache
nano -w configure.php (Add --with-imap=/usr/local/imap-2000e \ to php config)
./build php (answer n to all questions)
But on 4.3.11 this no longer works and needs further investigation.
I wonder is there further result to this solution that will work with current DA 1.255 and PHP 4.3.11?
Thanks
~Rocky
Sorry, but I do no longer have any DA licenses.
If someone has a server I can access or a license to spare, I can get you the answer....
Tino
rocky
12-18-2005, 08:14 AM
Originally posted by tino
Sorry, but I do no longer have any DA licenses.
If someone has a server I can access or a license to spare, I can get you the answer....
Tino
Thank Tino, I think you can get a temporary license from DA for testing.
~rocky
rocky
12-20-2005, 08:01 AM
Originally posted by ManageMyService
Just thought i'd also update this thread to mention that teh following works on 4.3.10 -
cd /home
mkdir build
cd build
wget http://files.directadmin.com/services/imapback.tar.gz
tar -zxvf imapback.tar.gz
cd imap-2002e
./buildit
cd c-client
make slx EXTRACFLAGS=-I/usr/kerberos/include EXTRALDFLAGS=-I/usr/kerberos/lib
mkdir /usr/local/imap-2000e/
mkdir /usr/local/imap-2000e/lib
mkdir /usr/local/imap-2000e/include
cp *.h /usr/local/imap-2000e/include
cp *.c /usr/local/imap-2000e/lib
cp c-client.a /usr/local/imap-2000e/lib
mv /usr/local/imap-2000e/lib/c-client.a /usr/local/imap-2000e/lib/libc-client.a
cd /usr/local/directadmin/customapache
nano -w configure.php (Add --with-imap=/usr/local/imap-2000e \ to php config)
./build php (answer n to all questions)
But on 4.3.11 this no longer works and needs further investigation.
Please anybody has a test server that can verify this work with current DA and 4.3.11
I have no access to test server but my live server.
Thanks for look into this
~rocky
rocky
12-21-2005, 12:21 AM
I just download the new file and follow the instruction like this but I am stuck at the command and everything below that.
cp *.h /usr/local/imap-2004g/include
cd /home
mkdir build
cd build
wget http://files.directadmin.com/services/da_imap-2004g.tar.gz
tar -zxvf da_imap-2004g.tar.gz
cd imap-2004g
./buildit
cd c-client
make slx EXTRACFLAGS=-I/usr/kerberos/include EXTRALDFLAGS=-I/usr/kerberos/lib
mkdir /usr/local/imap-2004g/
mkdir /usr/local/imap-2004g/lib
mkdir /usr/local/imap-2004g/include
cp *.h /usr/local/imap-2004g/include
cp *.h /usr/local/imap-2004g/include
cp *.c /usr/local/imap-2004g/lib
cp c-client.a /usr/local/imap-2004g/lib
mv /usr/local/imap-2004g/lib/c-client.a /usr/local/imap-2004g/lib/libc-client.a
cd /usr/local/directadmin/customapache
nano -w configure.php (Add --with-imap=/usr/local/imap-2000e \ to php config)
./build php (answer n to all questions)
My server OS is CentOS4.1 and 4.3.11
a few of my websites need to have that install for the SugarCRM to work.
Thanks
Rocky
Originally posted by rocky
mv /usr/local/imap-2004g/lib/c-client.a /usr/local/imap-2004g/lib/libc-client.a
cd /usr/local/directadmin/customapache
nano -w configure.php (Add --with-imap=/usr/local/imap-2000e \ to php config)
./build php (answer n to all questions)
Why did you add --with-imap=/usr/local/imap-2000e when you explicity put all the files in /usr/local/imap-2004g?
rocky
12-21-2005, 10:34 AM
Originally posted by toml
Why did you add --with-imap=/usr/local/imap-2000e when you explicity put all the files in /usr/local/imap-2004g?
So Tom what is the right way to install this I am Linux fresh user, I have no idea what to do right now. I am totally lost :)
Thanks
Rocky
Originally posted by rocky
So Tom what is the right way to install this I am Linux fresh user, I have no idea what to do right now. I am totally lost :)
Thanks
Rocky
The line you added tells it to look for the files in the /usr/local/imap-2000e directory structure, you put all the files in /usr/local/imap-2004g, so you need to change the line in configure.php to /usr/local/imap-2004g. You mostly followed someone elses directions, except they really did put all their files in /usr/local/imap-2000e, and that is why it worked for them.
rocky
12-21-2005, 10:43 AM
Originally posted by toml
The line you added tells it to look for the files in the /usr/local/imap-2000e directory structure, you put all the files in /usr/local/imap-2004g, so you need to change the line in configure.php to /usr/local/imap-2004g. You mostly followed someone elses directions, except they really did put all their files in /usr/local/imap-2000e, and that is why it worked for them.
Currently I am stuck at this command and I cannot go farther.
cp *.h /usr/local/imap-2004g/include
Thanks
Rocky
Originally posted by rocky
Currently I am stuck at this command and I cannot go farther.
cp *.h /usr/local/imap-2004g/include
Thanks
Rocky
Are you sure you did the
cd c-client
part? Without that, you won't have any .h , .c and the .a file in the current directory.
rocky
12-21-2005, 11:58 AM
Ok , get past the cp *.h and cp *.c part, now I am stuck at cp c-client.a /usr/local/imap-2004g/lib
Thanks
Rocky
If you followed the exact steps you listed, with the exception of configure.php edit, it should have been built in the c-client directory, the same directory the .h and .c files were.
hostpc.com
01-03-2006, 01:42 PM
Are these instructions still valid with Dovecot enabled?
This just adds IMAP client support, it has nothing to do with which IMAP server is used. So, yes this would still apply for Dovecot, as well as Cyrus, Courier, UW and any other IMAP server. They all speak the IMAP protocol and that is what this step adds support for.
rocky
01-05-2006, 06:19 PM
Is this php-imap build from the sources is customed for DA?
Can I use yum to install this module?
"yum install php-imap"
Because I still have problem to build from the sources.
Thanks
Rocky
redeye
02-16-2006, 06:22 AM
How about php5, is there another version of imap?
wow what a royal pain, I have tried everything posted here on Fedora4 with no luck.
Icheb
05-09-2006, 01:36 AM
Originally posted by rocky
Is this php-imap build from the sources is customed for DA?
Can I use yum to install this module?
"yum install php-imap"
Because I still have problem to build from the sources.
Thanks
Rocky
No, you can't use yum.
That *will* break your PHP install created by DA/custombuilder.
How about php5, is there another version of imap?
Don't quote me on it, but the way how you can do it, is exactly the same as with PHP 4.
wow what a royal pain, I have tried everything posted here on Fedora4 with no luck.
What kind of problems do you run into?
streamservice
05-11-2006, 01:42 PM
Is there an option to change something in the php.ini to enable IMAP whitout recompiling it?
OS: debian 3.1
Controlpanel: DirectAdmin (offcourse)
Originally posted by streamservice
Is there an option to change something in the php.ini to enable IMAP whitout recompiling it?
OS: debian 3.1
Controlpanel: DirectAdmin (offcourse)
No, you need the IMAP API symbols available, and to get those, it needs to be linked to the IMAP client library. And the hooks to use that library need to be turned on, which happens during the build phase.
FransVanNispen
04-09-2007, 09:45 AM
What to do?
checking for iconv support... no
checking for IMAP support... yes
checking for IMAP Kerberos support... yes
checking for IMAP SSL support... no
checking for pam_start in -lpam... yes
checking for crypt in -lcrypt... yes
configure: error: Kerberos libraries not found.
Check the path given to --with-kerberos (if no path is given, searches in /usr/kerberos, /usr/local and /usr )
*** There was an error while trying to configure php. Check the configure.php file
It looks like this is all a 64bit<->32bit incompatibility.
On my 64bit CentOS boxes, none of them have either a /usr/kerberos/lib or /usr/kerberos/lib64 folder.
Installing the original 64bit c-client lib by running:
up2date -u libc-client* does install the libc-client.a, but the php configuration cannot find it, as it appearently only checks for a 32 bit version.
Disabling --with-kerberos does compile, but gives me a link error in relocation of 64 to 32 bit in libc-client.a, the one build from the DA file.
Even when installing both kerberos 5 64bit and 32bit libraries, the php configuration seems unable to find them when enabling imap.
Without IMAP enabled, ldd /usr/local/bin/php clearly shows that kerberos 5 IS installed and linked to corectly:
libgssapi_krb5.so.2 => /usr/lib64/libgssapi_krb5.so.2 (0x00000030ab200000)
libkrb5.so.3 => /usr/lib64/libkrb5.so.3 (0x00000030aad00000)
libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00000030aab00000)
libk5crypto.so.3 => /usr/lib64/libk5crypto.so.3 (0x00000030ab400000)
Maybe it's all just a bug in PHP with the new IMAP ?
Why did they change IMAP to need libc-client anyways, while it has worked before without this?
FransVanNispen
04-16-2007, 10:03 AM
In order to get the PHP IMAP extention to compile correctly, just manually add the libc-client like written in a previous post.
On CentOS 64bit, you then get an error regarding kerberos5.
To solve this, remove the configure option --with-kerberos
and add:
--enable-pic
It might also helptto add the option:
--with-libdir=lib64
EDIT: It seems you also need to compile c-client with PIC enambled.
To do this, edit the Makefile. Change these lines:
#EXTRACFLAGS= DA CHANGED
EXTRACFLAGS=-I/usr/kerberos/include -L/usr/kerberos/lib
To:
#EXTRACFLAGS= DA CHANGED
EXTRACFLAGS=-I/usr/kerberos/include -L/usr/kerberos/lib -fPIC
I'm not sure if people are still having problems with this, but life has become much easier over the last few years... :-)
If you have CentOS or something you dan do this;
yum install libc-client
yum install libc-client-devel
in the configure.php don't add --with-imap=/bla/bla but this:
--with-imap-ssl \
--with-imap
that's all...
Oh yeah, if you are running 64bits, you need the -fPIC like stated earlier.
Tino
Reyner
05-29-2007, 01:22 AM
I'm not sure if people are still having problems with this, but life has become much easier over the last few years... :-)
If you have CentOS or something you dan do this;
yum install libc-client
yum install libc-client-devel
in the configure.php don't add --with-imap=/bla/bla but this:
--with-imap-ssl \
--with-imap
that's all...
Oh yeah, if you are running 64bits, you need the -fPIC like stated earlier.
Tino
Tino,
Thank you so much. This helps a lot!
Best regards,
Reyner Natahamidjaja
congkai
10-26-2007, 10:40 AM
/usr/local/directadmin/customapache/configure.php: line 30: --with-imap-ssl: command not found
*** There was an error while trying to configure php. Check the configure.php file
FransVanNispen
10-26-2007, 10:51 AM
/usr/local/directadmin/customapache/configure.php: line 30: --with-imap-ssl: command not found
*** There was an error while trying to configure php. Check the configure.php file
Can you post the whole contents of your configure.php(_ap2) file?
I expect you are missing a trailing '\' somewhere
congkai
10-26-2007, 10:52 AM
its okay. i sloved
REMEMBER TO ADD A \ IN THE LAST LINE OF CONFIGURE.PHP BEFORE ADDING THE 2 LINES.
AND A MUST TO RESTART HTTPD.
djcronos
03-23-2008, 09:54 AM
I'm not sure if people are still having problems with this, but life has become much easier over the last few years... :-)
If you have CentOS or something you dan do this;
yum install libc-client
yum install libc-client-devel
in the configure.php don't add --with-imap=/bla/bla but this:
--with-imap-ssl \
--with-imap
that's all...
Oh yeah, if you are running 64bits, you need the -fPIC like stated earlier.
Tino
This works flawlessly running CentOS 5.1 with Apache2 and the custombuild script for DirectAdmin. Thank you!
Saeven
07-02-2008, 09:38 PM
I've done this before, but this one is unusual...
I have a customer running DA, CentOS 4.6 64-bit.
After attempting to rebuild kerberos/imap a bit as was done in the initial posts in this thread, I've resorted to installing the libraries provided by yum, libc-client, and libc-client-devel
Both libraries are installed, and my configure command is successful.
When attempting to issue "make" after the fact however, the system farts on /usr/include/imap/unix.h because MAILSTREAM is not defined (seems it is defined in mail.h, but is never included..)
Configure command (config command is in phpcompile)
[root@srv04 php-5.2.6]# ./phpcompile 2>&1 | grep IMAP
checking for IMAP support... yes
checking for IMAP Kerberos support... yes
checking for IMAP SSL support... yes
checking whether build with IMAP works... yes
The exact compiler output is:
[root@srv04 php-5.2.6]# make
/bin/sh /devel/php-5.2.6/libtool --silent --preserve-dup-deps --mode=compile gcc -Iext/libxml/ -I/devel/php-5.2.6/ext/libxml/ -DPHP_ATOM_INC -I/devel/php-5.2.6/include -I/devel/php-5.2.6/main -I/devel/php-5.2.6 -I/usr/include/libxml2 -I/usr/local/include -I/usr/kerberos/include -I/devel/php-5.2.6/ext/date/lib -I/usr/include/freetype2 -I/usr/include/imap -I/devel/php-5.2.6/ext/mbstring/oniguruma -I/devel/php-5.2.6/ext/mbstring/libmbfl -I/devel/php-5.2.6/ext/mbstring/libmbfl/mbfl -I/usr/include/mysql -I/devel/php-5.2.6/TSRM -I/devel/php-5.2.6/Zend -I/usr/include -g -O2 -c /devel/php-5.2.6/ext/libxml/libxml.c -o ext/libxml/libxml.lo
In file included from /devel/php-5.2.6/Zend/zend.h:72,
from /devel/php-5.2.6/main/php.h:34,
from /devel/php-5.2.6/ext/libxml/libxml.c:28:
/usr/include/imap/unix.h:182: error: syntax error before "MAILSTREAM"
/usr/include/imap/unix.h:182: warning: no semicolon at end of struct or union
/usr/include/imap/unix.h:189: error: syntax error before '}' token
/usr/include/imap/unix.h:189: warning: data definition has no type or storage class
/usr/include/imap/unix.h:193: error: syntax error before '*' token
/usr/include/imap/unix.h:193: warning: data definition has no type or storage class
/usr/include/imap/unix.h:196: error: syntax error before '*' token
/usr/include/imap/unix.h:197: error: syntax error before '*' token
/usr/include/imap/unix.h:198: error: syntax error before '*' token
/usr/include/imap/unix.h:199: error: syntax error before '*' token
/usr/include/imap/unix.h:200: error: syntax error before '*' token
/usr/include/imap/unix.h:201: error: syntax error before '*' token
/usr/include/imap/unix.h:202: error: syntax error before '*' token
/usr/include/imap/unix.h:202: error: syntax error before '*' token
/usr/include/imap/unix.h:202: warning: data definition has no type or storage class
/usr/include/imap/unix.h:203: error: syntax error before '*' token
/usr/include/imap/unix.h:204: error: syntax error before '*' token
/usr/include/imap/unix.h:206: error: syntax error before '*' token
/usr/include/imap/unix.h:207: error: syntax error before '*' token
/usr/include/imap/unix.h:209: error: syntax error before '*' token
/usr/include/imap/unix.h:210: error: syntax error before '*' token
/usr/include/imap/unix.h:211: error: syntax error before '*' token
/usr/include/imap/unix.h:212: error: syntax error before '*' token
/usr/include/imap/unix.h:213: error: syntax error before '*' token
/usr/include/imap/unix.h:214: error: syntax error before '*' token
/usr/include/imap/unix.h:215: error: syntax error before '*' token
/usr/include/imap/unix.h:216: error: syntax error before '*' token
/usr/include/imap/unix.h:219: error: syntax error before '*' token
/usr/include/imap/unix.h:221: error: syntax error before "DOTLOCK"
/usr/include/imap/unix.h:222: error: syntax error before "MAILSTREAM"
/usr/include/imap/unix.h:223: error: syntax error before '*' token
/usr/include/imap/unix.h:224: error: syntax error before '*' token
/usr/include/imap/unix.h:225: error: syntax error before '*' token
/usr/include/imap/unix.h:226: error: syntax error before '*' token
/usr/include/imap/unix.h:228: error: syntax error before '*' token
/usr/include/imap/unix.h:229: error: syntax error before '*' token
/usr/include/imap/unix.h:230: error: syntax error before '*' token
/usr/include/imap/unix.h:231: error: syntax error before '*' token
In file included from /devel/php-5.2.6/main/php.h:92,
from /devel/php-5.2.6/ext/libxml/libxml.c:28:
/usr/include/imap/unix.h:159: error: redefinition of `struct unix_local'
/usr/include/imap/unix.h:171: error: redefinition of typedef 'UNIXLOCAL'
/usr/include/imap/unix.h:171: error: previous declaration of 'UNIXLOCAL' was here
/usr/include/imap/unix.h:181: error: nested redefinition of `struct unix_file'
/usr/include/imap/unix.h:182: error: syntax error before "MAILSTREAM"
/usr/include/imap/unix.h:182: warning: no semicolon at end of struct or union
/usr/include/imap/unix.h:189: error: syntax error before '}' token
/usr/include/imap/unix.h:189: warning: data definition has no type or storage class
/usr/include/imap/unix.h:193: error: syntax error before '*' token
/usr/include/imap/unix.h:193: warning: data definition has no type or storage class
/usr/include/imap/unix.h:196: error: syntax error before '*' token
/usr/include/imap/unix.h:197: error: syntax error before '*' token
/usr/include/imap/unix.h:198: error: syntax error before '*' token
/usr/include/imap/unix.h:199: error: syntax error before '*' token
/usr/include/imap/unix.h:200: error: syntax error before '*' token
/usr/include/imap/unix.h:201: error: syntax error before '*' token
/usr/include/imap/unix.h:202: error: syntax error before '*' token
/usr/include/imap/unix.h:202: error: syntax error before '*' token
/usr/include/imap/unix.h:202: warning: data definition has no type or storage class
/usr/include/imap/unix.h:203: error: syntax error before '*' token
/usr/include/imap/unix.h:204: error: syntax error before '*' token
/usr/include/imap/unix.h:206: error: syntax error before '*' token
/usr/include/imap/unix.h:207: error: syntax error before '*' token
/usr/include/imap/unix.h:209: error: syntax error before '*' token
/usr/include/imap/unix.h:210: error: syntax error before '*' token
/usr/include/imap/unix.h:211: error: syntax error before '*' token
/usr/include/imap/unix.h:212: error: syntax error before '*' token
/usr/include/imap/unix.h:213: error: syntax error before '*' token
/usr/include/imap/unix.h:214: error: syntax error before '*' token
/usr/include/imap/unix.h:215: error: syntax error before '*' token
/usr/include/imap/unix.h:216: error: syntax error before '*' token
/usr/include/imap/unix.h:219: error: syntax error before '*' token
/usr/include/imap/unix.h:221: error: syntax error before "DOTLOCK"
/usr/include/imap/unix.h:222: error: syntax error before "MAILSTREAM"
/usr/include/imap/unix.h:223: error: syntax error before '*' token
/usr/include/imap/unix.h:224: error: syntax error before '*' token
/usr/include/imap/unix.h:225: error: syntax error before '*' token
/usr/include/imap/unix.h:226: error: syntax error before '*' token
/usr/include/imap/unix.h:228: error: syntax error before '*' token
/usr/include/imap/unix.h:229: error: syntax error before '*' token
/usr/include/imap/unix.h:230: error: syntax error before '*' token
/usr/include/imap/unix.h:231: error: syntax error before '*' token
make: *** [ext/libxml/libxml.lo] Error 1
Anyone ever seen anything like this?
Cheers.
Alex
Saeven
07-03-2008, 12:20 PM
Well, I've found a fix for my issue, here's what was done:
-- Compiling PHP 5.2.6 + IMAP 2004g on a 64 bit system --
1. Install Kerberos
x) cd into your sandbox directory
a) wget http://web.mit.edu/Kerberos/dist/krb5/1.5/krb5-1.5.4-signed.tar
b) unpack the archive
c) cd krb5-1.5.4/src
d) ./configure
e) make
*** do not 'make install'!!
2. Install IMAP 2004g
Step c may need to be adjusted depending on your OS, and the paths to your kerberos libs (created above)
x) cd into your sandbox directory
a) wget ftp://ftp.cac.washington.edu/imap/old/imap-2004g.tar.Z
b) tar -zxf imap-2004g.tar.Z
c) make lr5 EXTRACFLAGS=-I/devel/krb5-1.5.4/src/include/ EXTRALDFLAGS=-I/devel/krb5-1.5.4/src/lib/ EXTRAAUTHENTICATORS=gss
*** do not 'make install'!
d) create symlinks whilst still inside the imap directory:
ln -sf c-client lib
ln -sf c-client include
3. Build PHP
x) cd into your sandbox directory
a) get the PHP source (5.2.6 at time of this post)
b) unpack the php source
c) drum up your configure command, and specify --with-imap=/xxx/imap-2004g/ --with-imap-ssl --with-kerberos
That should do the trick! This was done on a CentOS 4.6 64-bit running DA. I think whatever the circumstances may be, building against the packages above would bypass any problems.
Good luck! This seems to be a hot topic!
transix
09-04-2008, 01:38 AM
This is how i have done it i tried all the options above but no luck i installed it on different kind of systems in the past and different kinds of php all need another way to handle it so try all the options
OS : Centos 5.2 64 bit (xen VM)
php : 5.2.6
Login as root
cd /usr/local/directadmin/customapache
wget http://files.directadmin.com/services/da_imap-2004g.tar.gz
tar -zxvf da_imap-2004g.tar.gz
cd imap-2004g
vi Makefile
Change
#EXTRACFLAGS= DA CHANGED
EXTRACFLAGS=-I/usr/kerberos/include -L/usr/kerberos/lib
To:
#EXTRACFLAGS= DA CHANGED
EXTRACFLAGS=-I/usr/kerberos/include -L/usr/kerberos/lib -fPIC
./buildit
cd c-client
mkdir /usr/local/imap-2004g/
mkdir /usr/local/imap-2004g/lib
mkdir /usr/local/imap-2004g/include
cp *.h /usr/local/imap-2004g/include
cp *.c /usr/local/imap-2004g/lib
cp c-client.a /usr/local/imap-2004g/lib
mv /usr/local/imap-2004g/lib/c-client.a /usr/local/imap-2004g/lib/libc-client.a
cd /usr/local/directadmin/customapache
vi configure.php
add
--with-imap=/usr/local/imap-2004g \
remove
--with-kerberos \
Save it
do a ./build clean
and a ./build php n
This worked for me
shaunchng
10-15-2008, 12:42 AM
Hey there, I am trying to install PHP-imap too, I am new with this but why is there a need to remove the
--with-kerberos \
in the configure.php?
vBulletin® v3.7.0, Copyright ©2000-2008, Jelsoft Enterprises Ltd.