Today I am trying to upgrade php on MacOS Mountain Lion. I followed MacTuts+ tutorial and on the step where I execute that long command:
the error can be fixed by removing the IMAP support, removing these lines
--with-imap=/usr/local/imap-2007
--with-imap-ssl
For those who have the same error on docker:
RUN apt-get update && apt-get install -y libc-client-dev libkrb5-dev && rm -r /var/lib/apt/lists/*
RUN docker-php-ext-configure imap --with-kerberos --with-imap-ssl \
&& docker-php-ext-install imap
This exact same problem came up for me on Fedora when trying to compile PHP 5.5.0.
The problem is related to the '--with-imap'
configuration parameter.
In order to solve this problem I compiled my own version of imap from the latest source (currently imap-2007f) and to do that I had to install some prerequisites. On fedora I did this...
yum install openssl openssl-devel pam-devel
wget ftp://ftp.cac.washington.edu/imap/imap-2007f.tar.gz
tar zxvf imap-2007f.tar.gz
Then I had to make a soft link so the compiler could find the libraries. In my case I did the following:
mkdir /usr/local/ssl
ln -s /usr/include /usr/local/ssl/include
and then compile:
cd imap-2007f
make lnp SSLTYPE=unix EXTRACFLAGS=-fPIC
Then I was able to compile PHP by adding the imap source path to the config param like so:
/path/to/php/src> ./configure ...other_params... '--with-imap=/path/to/imap-2007f' '--with-imap-ssl'
make
make install
If you have the 'libc-client-devel' RPM or other package in your OS repository then install it.
This will provide the c-client library and header files which PHP needs for IMAP support.
Old threads never die ...
I'm on OSX Yosemite 10.10.5, and have installed my own php, currently 5.6.1, and want to upgrade to 5.6.13 - came across that same error just following imap.
Saw this thread, and ran brew install map-uw
then ran configure
based on my existing phpinfo
output.
./configure \
--prefix=/usr/local/php5 \
--with-apxs2=/usr/sbin/apxs \
--with-config-file-scan-dir=/usr/local/php5/php.d \
--with-openssl=/usr \
--with-zlib=/usr \
--with-zlib-dir=/usr \
--with-gd \
--with-ldap \
--with-xmlrpc \
--enable-exif \
--enable-soap \
--enable-wddx \
--enable-ftp \
--enable-sockets \
--with-bz2=/usr \
--enable-zip \
--enable-shmop \
--enable-sysvsem \
--enable-sysvshm \
--enable-sysvmsg \
--enable-mbstring \
--enable-bcmath \
--enable-calendar \
--with-mhash \
--enable-fpm \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--enable-pcntl \
--enable-dtrace \
--enable-opcache \
--disable-phpdbg \
--with-icu-dir=/usr/local/php5 \
--with-mssql=shared,/usr/local/php5 \
--with-pdo-dblib=shared,/usr/local/php5 \
--with-libxml-dir=shared,/usr/local/php5 \
--with-xsl=shared,/usr/local/php5 \
--with-imap=shared,/usr/local/Cellar/imap-uw/2007f \
--with-kerberos=/usr \
--with-imap-ssl=/usr \
--with-gettext=/usr/local/php5 \
--with-curl=shared,/usr/local/php5 \
--with-png-dir=/usr/local/php5 \
--with-jpeg-dir=/usr/local/php5 \
--enable-gd-native-ttf \
--with-freetype-dir=/usr/local/php5 \
--with-pgsql=shared,/usr/local/php5 \
--with-pdo-pgsql=shared,/usr/local/php5 \
--with-mcrypt=shared,/usr/local/php5 \
--with-tidy=/usr/local/php5 \
--with-gmp=shared,/usr/local/php5 \
--with-readline=shared,/usr/local/php5
Then make
. And it seems to be working fine.
Install imap before installing php.
brew install imap-uw
then
brew install php55 --with-fpm --with-imap --without-apache --with-debug
The --with-imap option should then run fine.