HOWTO: PHP with IMAP support for CentOS6

Thanks, you was right. dos2unix fixed it. Running it now ...
 
@smtalk, after using your script to install, and then change the php configuration file and then recompile php, it seems to work but I get this warning when recompiling php:

Code:
/usr/local/php-imap/lib/libc-client.a(osdep.o): In function `ssl_onceonlyinit':
/root/imap-2007f/c-client/osdep.c:302: warning: the use of `tmpnam' is dangerous, better use `mkstemp'

Do you have a comment about that?
 
That's normal. tmpnam is used in imap-2007f/c-client/osdep.c, that's why you get a warning. You may change it to mkstemp if you'd like to, however, UW imap is created by a professional coder, so I see no reasons not to trust the code, tmpnam is completely safe in the hands of a good programmer :)
 
Thank you for the confirmation, smtalk! Also when testing it seems to work fine! :) However one last thing I am worried about when reading http://thedirectadmin.com/?p=15

the libc-client package is compiled with a low “FD_SETSIZE” limit (I assume 256). when adding imap support to php, compiling against the default libc-client RPMs, this will cause Apache to segfault if Apache has over 256 open file descriptors. All active apache logs count against this limit so its easy to hit on a shared hosting server.

and

Code:
edit src/osdep/unix/os_art.c and src/osdep/unix/os_sv2.c in an editor,

find this:

Code:
#define FD_SETSIZE 256
change it to:

Code:
#define FD_SETSIZE 32768

Would you think this need to be changed? My servers are used for shared hosting clients.
 
On my test server I did install libc-client and libc-client-devel with yum before running smtalk script. But is it really needed to install libc-client and libc-client-devel when using smtalk script?

Edit: I tested on a different server without installing libc-client and libc-client-devel, and it also works. So it seems those are not needed?
 
Last edited:
I am trying to test if php imap works, it looks good in phpinfo file. But I am trying this script: http://www.inkplant.com/code/imap-mailbox-test.php

But I only get this error:

Code:
Error opening mailbox: [CLOSED] IMAP connection broken (server response)

So, is it something wrong with my imap php, or is it my test that is broken? Any other way to test if imap in php works?
 
Also, the command to use are into the script, just manual use them... or tell me you OS and i just copy/paste them to you from the script...

Regards
 
I have already installed using smtalk script, and everything works correct now. Please note it is not needed to install libc-client and libc-client-devel, it works without them.

My os is centos 6.4 64bit
 
After installing imap with smtalk script, wich by the way seem to work very well, I get these warnings in Logwatch:

Code:
 --------------------- Kernel Begin ------------------------ 
 
 
 WARNING:  Segmentation Faults in these executables
    conftest :  1 Time(s)
 
 ---------------------- Kernel End -------------------------

I don't think it is anything to worry about, but maybe someone has a different opinion about that?
 
Php-imap

I have all commands that Maniak placed in his post on 1-8-2013 and did not received any errors.

But if we want to use it for a 'Process Bounced Emails' it states that the server still does not have the required PHP-IMAP modules installed.

I am quite new in this and running out of options.

Can anybody assist me in checking what I am doing wrong?
 
I have all commands that Maniak placed in his post on 1-8-2013 and did not received any errors.

But if we want to use it for a 'Process Bounced Emails' it states that the server still does not have the required PHP-IMAP modules installed.

I am quite new in this and running out of options.

Can anybody assist me in checking what I am doing wrong?


Which PHP instance are you calling, what is the exact path?
What happens when you call that path with the "-m" option?
 
Which PHP instance are you calling, what is the exact path?
What happens when you call that path with the "-m" option?


Hallo Maniak,
Thank you for wanting to assist me.
As I said: I am quite new in this so forgive me if I can not give you the requested answers directly.

We want to work with a newsletter system that has a bounce.php cron job (Interspire Email Marketer).
If we want to run it, it gives the error: "IMAP module not found for PHP CLI" (Error Source "Internal")

To make sure I do not make big errors in our server it would be nice if you could check this for yourself.
If needed I can send you privately some login details, just let me know what you need.
 
trying to do this now and I get this error:
--with-imap=/usr/local/php-imap: No such file or directory
using the 2007f version I get same error
--with-imap-ssl=/usr/local/imap-2007f: No such file or directory

somehow the script is not creating the directories ?
am I missing something?
 
trying to do this now and I get this error:

using the 2007f version I get same error


somehow the script is not creating the directories ?
am I missing something?

yeah I was missing something, a trailing / on line before I entered these 2 lines.
 
Please forgive the dumb question..

But which configure.php file do I use? Not knowing anything, I did a search.:

[root@direct ~]# find / -name "configure.php"
[root@direct ~]# find / -name "configure.php5"
/usr/local/directadmin/custombuild/configure/ap1/configure.php5
/usr/local/directadmin/custombuild/configure/ap2/configure.php5
/usr/local/directadmin/custombuild/configure/suphp/configure.php5

Then I found three configure.php5 files..
Could someone clarify that last step?
 
I suggest you to follow this guide: http://www.directadmin.com/imap.txt
Be careful when adding modules to PHP.

Thank you,

The closest I got was by following the instructions directly from the directadmin folks here:
http://www.directadmin.com/imap.txt

Half way down, you''ll see the error lucky folks running centos 64bit, like me, will see:
"Cannot find imap library (libc-client.a). Please check your c-client installation."

I can't seem to resolve that issue. Reloaded DA like 10 times from scratch trying..
 
Half way down, you''ll see the error lucky folks running centos 64bit, like me, will see:
"Cannot find imap library (libc-client.a). Please check your c-client installation."

Try running this:

yum install -y pam-devel libc-client libc-client-devel krb5-appl-clients.x86_64 krb5-appl-servers.x86_64
ln -s /usr/lib64/libc-client.a /usr/lib/libc-client.a

and run again the full procedure over.
 
Last edited:
Back
Top