skip to Main Content

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


  1. Chosen as BEST ANSWER

    I worked to solved the issue by doing the following:

    1- create new directory for imap

    mkdir /usr/local/imap 
    

    2- downloaded client-c from here inside created directory by:

    wget http://ftp.ntua.gr/pub/net/mail/imap/c-client.tar.gz
    

    3- tar downloaded file:

    tar -xvzf c-client.tar.gz 
    

    4- inide created directory imap-227f create two new directories like following:

    mkdir lib
    mkdir include
    

    5- go to c-client source code

    cd imap-2007f/src/c-client/
    

    6- copy all the *.h files into include/ and all the *.c files into lib/

    cp *.h /usr/local/imap/imap-2007f/include/
    cp *.c /usr/local/imap/imap-2007f/lib/
    

    7- go to imap ext directory inside php, in my case was:

    cd /usr/local/src/php-5.5.38/ext/imap
    

    8- do phpize

    9- install imap-devel for centos

    sudo yum install uw-imap-devel
    

    10- configure by doing:

    ./configure --with-libdir=lib64  --with-kerberos --with-imap-ssl 
    

    11- do make

    12- after make, it will give the directory to imap.so extension, if not, do:

    find / -name imap.so
    

    13- do php -i | grep extension_dir to find extensions directory of php, then copy the compiled extension to that directory:

    cp .libs/imap.so /opt/php5/lib/php/extensions/no-debug-non-zts-20121212/
    

    14- do php -i | grep 'Configuration File' to find the loaded php.ini, then add the new compiled extension to it extension=imap.so:

    nano /opt/php5/etc/php.ini 
    add: extension=imap.so
    

    15- restart php, for php-fpm:

    /etc/init.d/php-fpm restart
    

    in this case you will overcome following two errors:

    configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL
    configure: error: Cannot find imap library (libc-client.a). Please check your c-client installation.
    

  2. Starting from the top:

    $ cd /usr/local/
    $ wget http://ftp.ntua.gr/pub/net/mail/imap/imap-2007f.tar.gz 
    $ tar -xvzf imap-2007f.tar.gz
    $ cd /imap-2007f
    $ make lrh
    

    imap should now be built… now adjust your php parameters in ./configure:

    ./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-xmlrpc --enable-fpm --with-pdo-oci=instantclient,/usr,12.1 --with-fpm-user=www-data --with-fpm-group=www-data --with-imap=/usr/local/imap-2007f/ --with-imap-ssl --enable-pic --with-libdir=/usr/local/imap-2007f/lib/
    

    If you receive an error in config.log such as:

    make: *** No rule to make target /usr/local/src/php-5.5.38/ext/imap/php_imap.c', needed by ext/imap/php_imap.lo'. Stop.
    

    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 your php with imap.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search