php with imap support

Patsjoelie

Verified User
Joined
Mar 5, 2008
Messages
28
Hi all ...
Just got my dedicated server (Fedora 5) and installed custombuild.
I'm trying to get SugarCRM working with imap support, but it seems this is not installed on the server.
It seems i need the IMAP c-client libraries enabled/compiled with the PHP module.

Here is my question:
Would someone be willing to write a dummies guide for me on how to do this without breaking everything?
I have been searching these forums, but didn't find any anwser that doesn't just start in the middle :)
I'm really new to all this and learning the hard way :))

thanks for any help on this,
have a great day!
Pat.
 
No guarantees!

Given you're using Apache 2 with PHP 5

1. Log in to your server
2.
Code:
cd /usr/local/directadmin/custombuild
mkdir custom
mkdir custom/ap2
cp -p configure/ap2/configure.php5 custom/ap2/configure.php5
nano -w configure.php5
3. Add to the end of the last line a backslash ( \ )
4. Add 2 new lines:
Code:
        --with-imap \
        --with-imap-ssl
5. Ctrl-O, Ctrl-X (Save, Exit)
6. ./build php d
 
Hi Ostendo,
thanks for your reply.
I'm gonna try this this evening.
However, trying to understand every step, a question:
What is the difference between the ap1 and ap2 directory?
Same files, what directory is used for what?

thanks!
Pat.
 
Hi Ostendo,
thanks for your reply.
I'm gonna try this this evening.
However, trying to understand every step, a question:
What is the difference between the ap1 and ap2 directory?
Same files, what directory is used for what?

thanks!
Pat.
The ap1 is for when you use Apache 1 and the ap2 for Apache 2
 
I have been struggling with this last evening.
It seems you have to download the client libraries and compile them.
Download here.
Next you have to build php with imap.
In configure.php, add --with-imap=/usr/local/imap-2007a \
So far so good, only problem i have currently is:
How to compile the libraries on Fedore Core 5 in a decent manner :)
Gonna work on this today, if i find a solution, i will post here.
In the mean while, all help is welcome!

thanks, have a great day!
Pat.
 
I've built imap for my CentOS with the following steps:

Dependencies: install pam-devel (yum or apt)

Code:
wget ftp://ftp.cac.washington.edu/mail/imap.tar.Z
tar zxf imap.tar.Z
cd imap-2007a
make lr5 PASSWDTYPE=std SSLTYPE=unix.nopwd IP6=4

echo "set disable-plaintext nil" > /etc/c-client.cf
mkdir /usr/local/imap-2007a
mkdir /usr/local/imap-2007a/include/
mkdir /usr/local/imap-2007a/lib/
chmod -R 077 /usr/local/imap-2007a
rm -rf /usr/local/imap-2007a/include/*
rm -rf /usr/local/imap-2007a/lib/*
rm -rf /usr/sbin/imapd

cp imapd/imapd /usr/sbin/
cp c-client/*.h /usr/local/imap-2007a/include/
cp c-client/*.c /usr/local/imap-2007a/lib/
cp c-client/c-client.a /usr/local/imap-2007a/lib/libc-client.a

Then i've changed the configure.php5 (in my ap2 folder) to include

Code:
	--with-imap-ssl=/usr/local/imap-2007a \
	--with-imap=/usr/local/imap-2007a \

you can try to use this configuration to see if it fits your needs.
 
I had imap installed before i upgraded from php4 to php5. Since the custombuild script does not uninstall anything I just had to modify both the
ap2 configure.php5 and the suphp configure.php5 with the following:
--with-imap
--with-imap-ssl

Now phpinfo() shows imap installed, but now I am getting a ssl error on the snakeoil. I can not view directadmin in https:// and I can't use imap in php because it gives me a cert error. It was giving me a imap error until i got --with-imap included. Anyone else have a issue with the snakeoil certs after doing a upgrade on anything like apache or php or anything else?
 
Hi visiGod,
I followed every steps of you and this time i could make imap without errors.
However, when i rebuild php
./build php d
I don't get any imap reference in my phpinfo file.
In configure.php5 i have:
--with-imap-ssl=/usr/local/imap-2007a \
--with-imap=/usr/local/imap-2007a \But when i create a file with <? phpinfo() ?>
I don't see this added to the ./configure command:
Configure Command:

'./configure' '--with-apxs2' '--with-curl=/usr/local/lib' '--with-gd' '--enable-gd-native-ttf' '--with-ttf' '--with-gettext' '--with-jpeg-dir=/usr/local/lib' '--with-freetype-dir=/usr/local/lib' '--with-kerberos' '--with-openssl' '--with-mcrypt' '--with-mhash' '--with-mysql=/usr' '--with-mysqli=/usr/bin/mysql_config' '--with-pear' '--with-png-dir=/usr/local/lib' '--with-zlib' '--with-zlib-dir=/usr/local/lib' '--enable-zip' '--with-iconv=/usr/local' '--enable-bcmath' '--enable-calendar' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-mbstring'

Any ideas on this?
Thanks 1000 times for your help!
Pat.
 
what is your server os? have you installed imap? try adding --with-imap and --with-imap-ssl to both the configure.php5 in the ap2 and the suphp directories
 
Hi scoutman,
I installed imap as described above (post from visiGod).
My server is running Fedore core 5.
since i'm running apache 2 i only have added this to the configure.php5 in the ap2 directory. The content of other configure.php(4)(5) files, and the one in the suphp dir are all commented out.

Thanks for your reply!
Pat.
 
Little follow-up;
When the php build ends, it gives me the following output:

PHP:
PHP 5.2.5 Installed.
Writing data to /etc/httpd/conf/extra/httpd-suphp.conf
Done.
Rewriting all users httpd.conf files, please wait...
In debug mode
Debug set to level 10
root priv set: uid:0 gid:0 euid:0 egid:0
pidfile written
staring queue
done queue
Restarting apache.
Stopping httpd:                                            [  OK  ]
Starting httpd: [Mon Mar 24 18:04:20 2008] [warn] module php5_module is already loaded, skipping

could this last line:
PHP:
Starting httpd: [Mon Mar 24 18:04:20 2008] [warn] module php5_module is already loaded, skipping

Have something to do with this?
thanks in advance,
Pat.
 
Ok, i have added:
Code:
--with-imap-ssl=/usr/local/imap-2007a \
--with-imap=/usr/local/imap-2007a \
in every configure.php file i could find.
In the ap1 and ap2 directory, both in configure.php4 and 5, and in the suphp one. Rebuild php and still nothing showing up in my <?phpinfo ()?> file .

Now i'm lost in the dark.
Really appreciate some help on this!
TIA,
Pat.
 
add it to the configure.php5 under the suphp directory under custombuild. I had the same issue. once you try that let me know. and you do not have to include the imap location just --with-imap and --with-imap-ssl
 
The entire file "configure.php5" in the suphp directory is quoted, line by line.
Example:
Code:
#!/bin/sh
"./configure" \
"--prefix=/usr/local/php5" \
"--enable-force-cgi-redirect" \
"--enable-fastcgi" \
"--with-config-file-path=/usr/local/etc/php5/cgi" \
"--with-curl" \
Do i have to use this configure file, and quote the one in the ap2 directory?
sorry for being so careful, but i really don't want to break this server!

Here is my options.conf regarding php:
Code:
#PHP settings. default_php possible values - 4 or 5
default_php=5
php4_cli=no
php4_cgi=yes
php5_cli=yes
php5_cgi=no
zend=yes
Thanks for your help,
really appreciate this!
Pat.
 
Below is my configure.php5 in the /usr/local/directadmin/custombuild/configure/suphp directory. I made both the one under the ap2 configure.php5 and the one under the suphp. Some reason when I just set the one under ap2/configure.php5 it did not build with imap. Try this and let me know i also built my php like this
./build php y
---------configure.php5---------------
"./configure" \
"--prefix=/usr/local/php5" \
"--enable-force-cgi-redirect" \
"--enable-fastcgi" \
"--with-config-file-path=/usr/local/etc/php5/cgi" \
"--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-freetype" \
"--with-freetype-dir=/usr/local/lib" \
"--with-kerberos" \
"--with-mcrypt" \
"--with-mhash" \
"--with-mysql=/usr" \
"--with-mysqli=/usr/bin/mysql_config" \
"--with-pear=/usr/local/lib/php" \
"--with-png-dir=/usr/local/lib" \
"--with-xml" \
"--with-zlib" \
"--with-zlib-dir=/usr/local/lib" \
"--with-zip" \
"--with-openssl" \
"--with-iconv=/usr/local" \
"--enable-bcmath" \
"--enable-calendar" \
"--enable-ftp" \
"--enable-magic-quotes" \
"--enable-sockets" \
"--enable-track-vars" \
"--enable-mbstring" \
"--disable-posix" \
"--enable-memory-limit" \
"--with-imap" \
"--with-imap-ssl"
 
Hi scoutman,
thanks for your reply!
I tried this last night.

So far i have done with the following files:
/usr/local/directadmin/custombuild/configure/suphp
/usr/local/directadmin/custombuild/configure/ap1
/usr/local/directadmin/custombuild/configure/ap2
both the configure.php4 and configure.php5 and configure.suphp

I have tried with adding:
--with-imap-ssl=/usr/local/imap-2007a \
--with-imap=/usr/local/imap-2007a \

And i have tried without the path:
--with-imap-ssl \
--with-imap \

No matter what i do, imap will not load.
Is it something little and stupid that i'm overlooking, or is something wrong with my config somewhere, i don't know anymore.

the command imapd --version gives me this:
Code:
* OK [CAPABILITY IMAP4REV1 LITERAL+ SASL-IR LOGIN-REFERRALS STARTTLS] s01.domain.com IMAP4rev1 2007a.403
Thanks for any help on this!
Have a great day!
Pat.
 
Yessssssss !!!!!!!
Finally got this working, and have been banging my head to the wall for the last 15 minutes !!!!!!

This post from smtalk made me think and check something.
And yes, a few days back i followed a how-to for this imap thing, and there i had to create that custom directory.
Offcourse, everytime i build php it used this configure.php5 file.
Deleted the whole directory, did the build again, and it worked just fine.

Once again learned something the hard way :cool:
Now the next thing, getting tomcat installed.

Thanks to everyone that helped me!!!
Pat.
 
I've built imap for my CentOS with the following steps:

Dependencies: install pam-devel (yum or apt)

Code:
wget ftp://ftp.cac.washington.edu/mail/imap.tar.Z
tar zxf imap.tar.Z
cd imap-2007a
make lr5 PASSWDTYPE=std SSLTYPE=unix.nopwd IP6=4

echo "set disable-plaintext nil" > /etc/c-client.cf
mkdir /usr/local/imap-2007a
mkdir /usr/local/imap-2007a/include/
mkdir /usr/local/imap-2007a/lib/
chmod -R 077 /usr/local/imap-2007a
rm -rf /usr/local/imap-2007a/include/*
rm -rf /usr/local/imap-2007a/lib/*
rm -rf /usr/sbin/imapd

cp imapd/imapd /usr/sbin/
cp c-client/*.h /usr/local/imap-2007a/include/
cp c-client/*.c /usr/local/imap-2007a/lib/
cp c-client/c-client.a /usr/local/imap-2007a/lib/libc-client.a

Then i've changed the configure.php5 (in my ap2 folder) to include

Code:
	--with-imap-ssl=/usr/local/imap-2007a \
	--with-imap=/usr/local/imap-2007a \

you can try to use this configuration to see if it fits your needs.


Just an addition about compiling imap on 64 bits systems.
Code:
wget ftp://ftp.cac.washington.edu/mail/imap.tar.Z
tar zxf imap.tar.Z
cd imap-2007a
-----------------
# edit Makefile 

nano Makefile

find: EXTRACFLAGS=

and add change it to:

EXTRACFLAGS=-fPIC

------------------
make lr5 PASSWDTYPE=std SSLTYPE=unix.nopwd IP6=4

echo "set disable-plaintext nil" > /etc/c-client.cf
mkdir /usr/local/imap-2007a
mkdir /usr/local/imap-2007a/include/
mkdir /usr/local/imap-2007a/lib/
chmod -R 077 /usr/local/imap-2007a
rm -rf /usr/local/imap-2007a/include/*
rm -rf /usr/local/imap-2007a/lib/*
rm -rf /usr/sbin/imapd

cp imapd/imapd /usr/sbin/
cp c-client/*.h /usr/local/imap-2007a/include/
cp c-client/*.c /usr/local/imap-2007a/lib/
cp c-client/c-client.a /usr/local/imap-2007a/lib/libc-client.a
 
Back
Top