[UPDATED 09-JUL-2011 with edits from emil_l]
____________________________________________________________________
Snow Leopard Server has PHP 5.3 built-in (hooray!), but without the IMAP module (drat!). There are several guides out there that have partial solutions to the problem, but most ask you to build your own Apache and PHP apart from the OSX native. I wanted to use as much native OSX as possible. One blog in particular was the easiest solution (with a few minor corrections in the blog comments). Here are all the instructions, in order, with all the corrections inline:
tar -zxvf php.tar.gz
____________________________________________________________________
5. We only need the source for the IMAP extension, so there's no need to compile all of PHP. Please note that there are double-hyphens in front of each "with" and single hyphens elsewhere (difficult to read with this font):
6. If you received errors (specifically, a complaint about OpenSSL's evp.h), you may need to adjust the path at the end of "with-imap-ssl" to /usr/include or /usr/include/openssl. The above worked for me, using Snow Leopard 10.6.3.
____________________________________________________________________
7. Now make the module:
make
____________________________________________________________________
8. If you didn't receive an error, go to the next step. If you received an error about pcre.h (notably on MAMP instead of Snow Leopard Server), you need to copy some files from the downloaded PHP source
make
____________________________________________________________________
9. And now we copy it into our extensions directory. Your directory might be named differently (the numbers at the end correspond to June 26, 2009), so if you don't have this exact directory, look for the subdirectory of /usr/lib/php/extensions that has the most recent creation date:
11. Find the section where there are other "extension=" commands (there should be 30-50 of them). The ones that end with ".dll" can be removed -- they only apply to Windows and just clutter up your file.
____________________________________________________________________
12. At the end of all the extension= statements, add the following:
13. DOUBLE-CHECK: if you had a different directory on your system (that didn't end with 20090626) adjust accordingly.
____________________________________________________________________
14. TRIPLE-CHECK: make absolutely sure there is NOT a semi-colon in front of the word "extension". This ; character means to ignore the whole line. Remove the semi-colon if it is present.
____________________________________________________________________
15. As long as you're in PHP.INI, you may want to adjust other options, such as memory allowed for PHP and file upload sizes. This step is optional:
16. When you are finished editing, press CTRL-X to exit. You will be prompted if you would like to save. Enter Y for Yes. Now we just need to restart Apache:
All done! If you would rather just cheat, I've attached the imap.so that I built to this posting (click below) and you can drop it into your extensions directory.
Thanks for the info. I went through this entire tutorial, I am completely un-versed in terminal, dabbled a couple lines here and there, but anyway I performed all of these steps. I am currently installing activecollab and I am getting the message in my environment test:
warning — Extension 'imap' was not found. This extension is used for connect to POP3/IMAP mailboxes and read email messages
Any idea why I am getting this message? If I performed these steps successfully I am assuming imap is enabled and operating. Any help is appreciated. Thank you very much!
I entered the command of sudo apachetcl graceful, entered my pw, I also stopped and restarted web services but still get the warning message in the browser.
Yeah I checked that at that step, it actually came up when I did a go to folder search. I have two folders within the extension, the one above, and one that is 20060613. Within the 20090626 I have the files of:
imap.so
phpcups.so
proxyauth.so
Hmm, I checked it out, they all seemed alright. I even added the "adminstrator" user I am currently logged in as with read/write access, restarted apache, and have the same error. This is what I currently get back in terminal. Once again thank you for the help.
Hmm, well I noticed I forgot the "g" at the end of "debug", I added that, restarted apache, thought FOR SURE this was going to fix it, and still get the same warning.
____________________________________________________________________
Snow Leopard Server has PHP 5.3 built-in (hooray!), but without the IMAP module (drat!). There are several guides out there that have partial solutions to the problem, but most ask you to build your own Apache and PHP apart from the OSX native. I wanted to use as much native OSX as possible. One blog in particular was the easiest solution (with a few minor corrections in the blog comments). Here are all the instructions, in order, with all the corrections inline:
____________________________________________________________________
1. Open a Terminal session from OSX
____________________________________________________________________
2. Download and unpack the latest IMAP source code (2007e as of this writing):
cd ~/Downloads
curl -o imap.tar.gz ftp://ftp.cac.washington.edu/imap/imap-2007e.tar.gz
tar -zxvf imap.tar.gz
____________________________________________________________________
3. Build IMAP libraries and copy to correct locations:
cd imap-2007e/
make osx EXTRACFLAGS="-arch i386 -arch x86_64 -g -Os -pipe -no-cpp-precomp"
sudo mkdir /usr/local/include
sudo cp c-client/*.h /usr/local/include/
sudo mkdir /usr/local/lib
sudo cp c-client/*.c /usr/local/lib/
sudo cp c-client/c-client.a /usr/local/lib/libc-client.a
____________________________________________________________________
4. Download and unpack the latest PHP source code (5.3.1 as of this writing):
cd ~/Downloads
curl -o php.tar.gz http://us.php.net/distributions/php-5.3.1.tar.gz
tar -zxvf php.tar.gz
____________________________________________________________________
5. We only need the source for the IMAP extension, so there's no need to compile all of PHP. Please note that there are double-hyphens in front of each "with" and single hyphens elsewhere (difficult to read with this font):
cd php-5.3.1/ext/imap
make clean
phpize
MACOSX_DEPLOYMENT_TARGET=10.6
CFLAGS="-arch i386 -arch x86_64 -g -Os -pipe -no-cpp-precomp"
CCFLAGS="-arch i386 -arch x86_64 -g -Os -pipe"
CXXFLAGS="-arch i386 -arch x86_64 -g -Os -pipe"
LDFLAGS="-arch i386 -arch x86_64 -bind_at_load"
./configure --with-imap=/usr/local/imap-2007 --with-kerberos --with-imap-ssl=/usr/
____________________________________________________________________
6. If you received errors (specifically, a complaint about OpenSSL's evp.h), you may need to adjust the path at the end of "with-imap-ssl" to /usr/include or /usr/include/openssl. The above worked for me, using Snow Leopard 10.6.3.
____________________________________________________________________
7. Now make the module:
make
____________________________________________________________________
8. If you didn't receive an error, go to the next step. If you received an error about pcre.h (notably on MAMP instead of Snow Leopard Server), you need to copy some files from the downloaded PHP source
sudo cp ../pcre/pcrelib/pcre.h /usr/include/php/ext/pcre/
make
____________________________________________________________________
9. And now we copy it into our extensions directory. Your directory might be named differently (the numbers at the end correspond to June 26, 2009), so if you don't have this exact directory, look for the subdirectory of /usr/lib/php/extensions that has the most recent creation date:
sudo cp modules/imap.so /usr/lib/php/extensions/no-debug-non-zts-20090626/
____________________________________________________________________
10. Now we edit the php.ini to reference our new imap.so extension:
sudo nano /etc/php.ini
____________________________________________________________________
11. Find the section where there are other "extension=" commands (there should be 30-50 of them). The ones that end with ".dll" can be removed -- they only apply to Windows and just clutter up your file.
____________________________________________________________________
12. At the end of all the extension= statements, add the following:
extension=/usr/lib/php/extensions/no-debug-non-zts-20090626/imap.so
____________________________________________________________________
13. DOUBLE-CHECK: if you had a different directory on your system (that didn't end with 20090626) adjust accordingly.
____________________________________________________________________
14. TRIPLE-CHECK: make absolutely sure there is NOT a semi-colon in front of the word "extension". This ; character means to ignore the whole line. Remove the semi-colon if it is present.
____________________________________________________________________
15. As long as you're in PHP.INI, you may want to adjust other options, such as memory allowed for PHP and file upload sizes. This step is optional:
memory_limit=128M
post_max_size=200M
upload_max_filesize=200M
____________________________________________________________________
16. When you are finished editing, press CTRL-X to exit. You will be prompted if you would like to save. Enter Y for Yes. Now we just need to restart Apache:
sudo apachectl graceful
____________________________________________________________________
____________________________________________________________________
All done! If you would rather just cheat, I've attached the imap.so that I built to this posting (click below) and you can drop it into your extensions directory.