Требования

Это расширение требует установленной библиотеки c-client. Возьмите последнюю версию с » ftp://ftp.cac.washington.edu/imap/ и скомпилируйте её.

Важно, чтобы вы не копировали исходные файлы IMAP непосредственно в системные include директории, это может вызвать конфликт. Вместо этого создайте новую директорию внутри системной include директории, например /usr/local/imap-2000b/ (месторасположение и имя зависит от вашей установленной версии IMAP), и внутри них создайте новые директории с именами lib/ и include/. Для c-client директории из вашей исходной директории IMAP скопируйте все *.h файлы в include/ и все *.c файлы в lib/. После того, как вы скомпилируете IMAP, будет создан файл с именем c-client.a. Затем переименуйте этот файл в libc-client.a и скопируйте его в lib/.

Замечание:

Для сборки библиотеки c-client с поддержкой SSL и/или Kerberos прочитайте документацию, поставляемую с пакетом.

Замечание: В Mandrake Linux, библиотека IMAP (libc-client.a) компилируется без поддержки Kerberos. Версия с поддержкой SSL (client-PHP4.a) устанавливается отдельно. Чтобы добавить поддержку Kerberos, перекомпилируйте библиотеку.

Коментарии

Spent hours and hours on compiling PHP with IMAP support on CentOS 64-bit but after many trial and error sessions I got if fixed.

If you have set the '--with-libdir=lib64' flag and you encounter the the 'cannot find the c-client library' error while compiling, try to create a symlink 'lib64' to 'lib' in your imap installation dir.

Apparantly, PHP will search only in lib64 directories if the flag is set. This also applies on the IMAP library but documentation lacks on this point.
2010-03-17 04:12:33
http://php5.kiev.ua/manual/ru/imap.requirements.html
Автор:
If you run into an error similar to the following when compiling / making PHP:

errno 0x21c /usr/local/imap-2007e/lib/libc-client.a(netmsg.o)
ld: fatal: relocations remain against allocatable but non-writable sections
make: Fatal error: Command failed for target `libphp5.la'

You need to recompile the IMAP library and add -fpic or -fPIC to your CFLAGS.

See:
http://bugs.php.net/bug.php?id=35465

Also, if you compiled OpenSSL from source, you'll need to do the same, as you'll get error messages for libc-client.a
2010-07-02 13:06:01
http://php5.kiev.ua/manual/ru/imap.requirements.html
After few hours of testing it on CentOS 5 64 bit I'd like to share the steps required to compile imap with php:

1. Install openssl:

   yum install openssl openssl-devel

2. If you don't have openssl compiled and installed in /usr/local/ssl create symlink:

   ln -s /usr/lib64/openssl/engines/ /usr/local/ssl

3. Add the libraries:

   ln -s /usr/include/ /usr/local/ssl/include

4. Compile IMAP

  cd /path/to/imap_src
  make lnp SSLTYPE=unix

5. Copy files as described above
 mkdir lib
 mkdir include
 cp c-client/*.c lib/
 cp c-client/*.h include/
 cp c-client/c-client.a lib/libc-client.a
 
6. Compile PHP
  cd /path/to/php/src
  ./configure --with-imap=/path/to/imap_src --with-libdir=lib64
2010-08-04 13:09:21
http://php5.kiev.ua/manual/ru/imap.requirements.html
Автор:
When compiling IMAP on a 64 bit machine, use: make EXTRACFLAGS=-fPIC.
2011-10-04 13:58:07
http://php5.kiev.ua/manual/ru/imap.requirements.html
Автор:
When compiling IMAP 2007f with php 5.3.27 on a 64 bit OL5.7 machine, add in the Makefile: EXTRACFLAGS=-fPIC and EXTRAAUTHENTICATORS=gss
2013-07-20 01:04:40
http://php5.kiev.ua/manual/ru/imap.requirements.html
For those using Ubuntu and who are completely daunted by compiling this, it's easy under Ubuntu:

Install libc-client-dev
# sudo apt-get install libc-client-dev

Install PHP5 imap:
# sudo apt-get install php5-imap

Restart Apache
# sudo service apache2 reload

Should work for most people.
2013-09-09 18:02:01
http://php5.kiev.ua/manual/ru/imap.requirements.html
A more secure & easy way to do this on Debian 7.7, php 5.4:

apt-get install php5-imap

Packages installed
  libc-client2007e mlock php5-imap
2015-01-27 19:32:29
http://php5.kiev.ua/manual/ru/imap.requirements.html
It should be noted that the source code archives at the University of Washington, and the mirrors, have been dead for some time.

There is a github repository located here: https://github.com/uw-imap/imap
2019-03-21 21:28:28
http://php5.kiev.ua/manual/ru/imap.requirements.html
Автор:
php-imap package is not available neither in Red Hat Enterprise Linux 7 nor 8.

To compile the extension yourself:

Prerequisites
# yum install pam-devel openssl-devel

Follow steps 2 and 3 from the previous post of "ldi at email dot cz"

Download the c-client library from github, you can see the link at the top of the page and compile with:
# make lr5 SSLINCLUDE=/usr/include/openssl/ EXTRACFLAGS=-fPIC
(if you are using another distro, instead of lr5 you will type something else, you can view the Makefile for other unix flavors)

Follow step 5 from the previous post of "ldi at email dot cz" which is what the second paragraph at the top of the page explains.

Download the PHP source code of the version installed in your system and go to the php/ext/imap folder.

# phpize
(If you installed the PHP packages from the Red Hat Software Collections you must run the following command before to set the enviroment eg: scl enable rh-php73 bash)

# ./configure --with-imap=<<path_to_where_you_unpacked_the_c-client_library_and_compiled_it>> --with-imap-ssl

# make

This creates the file php/ext/imap/modules/imap.so :)
Copy it to your extension_dir (you can find it in the phpinfo() page).
Create an .ini file in the php.d folder with the text: extension=imap.so

Restart apache and be happy.

P.S. You could probably find the extension compiled out there but who knows the trustiness of the source so better to get the official unaltered sources.
2022-10-06 03:01:50
http://php5.kiev.ua/manual/ru/imap.requirements.html
Автор:
The Alpine email client which was also originally developed by Mark Crispin at UW also uses the "c-client" library and that it is still actively developed by Eduardo Chappa: https://alpineapp.email/alpine/release/ . It has its own updated copy of the "c-client" library which supports new features like OAuth2 authentication, etc.

The development of the UW IMAP and Alpine "c-client" libraries can be compared via https://github.com/uw-imap/imap/commits/master/src/c-client and https://repo.or.cz/alpine.git/history/HEAD:/imap/src/c-client

If this PHP extension does not work with Alpine "c-client", it might behoove someone to port the PHP so it does.
2024-04-19 19:42:44
http://php5.kiev.ua/manual/ru/imap.requirements.html

    Поддержать сайт на родительском проекте КГБ