I am trying to compile php with imap from its source code, but while running the following configure
command:
./configure
--prefix=/opt/php5
--with-config-file-path=/opt/php5/etc
--with-config-file-scan-dir=/opt/php5/etc/php.d
--with-curl
--with-gd
--with-jpeg-dir=/usr/lib64
--with-png-dir
--with-xpm-dir
--with-freetype-dir
--with-t1lib
--with-mcrypt
--with-mhash
--with-mysql
--with-mysqli
--with-pdo-mysql
--with-openssl
--with-xsl
--with-bz2
--with-gettext
--with-pear
--with-zlib
--enable-exif
--enable-wddx
--enable-bcmath
--enable-calendar
--enable-ftp
--enable-mbstring
--enable-soap
--enable-sockets
--enable-shmop
--enable-dba
--enable-sysvmsg
--enable-sysvsem
--enable-zip
--enable-sysvshm
--with-libdir=lib64
--with-xmlrpc
--enable-fpm
--with-pdo-oci=instantclient,/usr,12.1
--with-imap=/usr/local/imap/imap-2004g/
--with-imap-ssl
--enable-pic
--with-imap=/usr/local/imap-2004g/lib
it give the following error:
configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen. Check config.log for additional information.
I installed all required libraries for utf8_mime2text
but same error kept occurring also tired the solution here
Package uw-imap-devel-2007f-16.el7.x86_64 already installed and latest version
the config.log
file show this that may be related:
configure:47265: checking for utf8_mime2text signature
configure:47287: cc -c -I conftest.c >&5
cc: fatal error: no input files
compilation terminated.
configure:47287: $? = 4
configure: failed program was:
OS: CentOS 7
Any advise?
2
Answers
I worked to solved the issue by doing the following:
1- create new directory for imap
2- downloaded client-c from here inside created directory by:
3- tar downloaded file:
4- inide created directory
imap-227f
create two new directories like following:5- go to c-client source code
6- copy all the
*.h
files intoinclude/
and all the*.c
files intolib/
7- go to imap ext directory inside php, in my case was:
8- do
phpize
9- install imap-devel for centos
10- configure by doing:
11- do
make
12- after make, it will give the directory to imap.so extension, if not, do:
13- do
php -i | grep extension_dir
to find extensions directory of php, then copy the compiled extension to that directory:14- do
php -i | grep 'Configuration File'
to find the loadedphp.ini
, then add the new compiled extension to itextension=imap.so
:15- restart php, for php-fpm:
in this case you will overcome following two errors:
Starting from the top:
imap
should now be built… now adjust yourphp
parameters in./configure
:You’re probably missing the
php_imap.c
file in the aforementioned directory. Once that’s resolved then you should be able to successfully build yourphp
withimap
.