PDA

View Full Version : php with imap support



Patsjoelie
03-17-2008, 01:22 PM
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.

ostendo
03-18-2008, 09:42 AM
No guarantees!

Given you're using Apache 2 with PHP 5

1. Log in to your server
2.
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:

--with-imap \
--with-imap-ssl
5. Ctrl-O, Ctrl-X (Save, Exit)
6. ./build php d

Patsjoelie
03-20-2008, 09:19 AM
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.

ostendo
03-20-2008, 10:26 AM
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

Patsjoelie
03-20-2008, 11:24 AM
<embarrassed> Stupid me </embarrassed>
Many times thanks!!

scoutman57
03-20-2008, 09:50 PM
Did you try this and get it to work? I thought you had to set the imap dir?

Patsjoelie
03-21-2008, 03:01 AM
I have been struggling with this last evening.
It seems you have to download the client libraries and compile them.
Download here (ftp://ftp.cac.washington.edu/imap/c-client.tar.Z).
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.

VisiGod
03-22-2008, 01:15 PM
I've built imap for my CentOS with the following steps:

Dependencies: install pam-devel (yum or apt)


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


--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.

scoutman57
03-22-2008, 02:32 PM
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?

Patsjoelie
03-24-2008, 10:31 AM
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.

scoutman57
03-24-2008, 10:39 AM
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

Patsjoelie
03-24-2008, 10:55 AM
Hi scoutman,
I installed imap as described above (post from visiGod (http://www.directadmin.com/forum/showpost.php?p=126917&postcount=8)).
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.

Patsjoelie
03-24-2008, 11:10 AM
Little follow-up;
When the php build ends, it gives me the following output:



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:

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.

Patsjoelie
03-24-2008, 12:28 PM
Ok, i have added:


--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.

scoutman57
03-24-2008, 01:13 PM
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

Patsjoelie
03-24-2008, 01:35 PM
The entire file "configure.php5" in the suphp directory is quoted, line by line.
Example:


#!/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:


#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.

scoutman57
03-24-2008, 02:18 PM
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"

Patsjoelie
03-25-2008, 03:15 AM
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:

* OK [CAPABILITY IMAP4REV1 LITERAL+ SASL-IR LOGIN-REFERRALS STARTTLS] s01.domain.com IMAP4rev1 2007a.403Thanks for any help on this!
Have a great day!
Pat.

Patsjoelie
03-25-2008, 04:21 AM
Yessssssss !!!!!!!
Finally got this working, and have been banging my head to the wall for the last 15 minutes !!!!!!

This post (http://www.directadmin.com/forum/showpost.php?p=114114&postcount=2) 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.

sHuKKo
05-24-2008, 07:24 PM
I've built imap for my CentOS with the following steps:

Dependencies: install pam-devel (yum or apt)


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


--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.


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