php / pecl-mail-imap

An extension to operate with the IMAP protocol, as well as the NNTP, POP3, and local mailbox access methods.
Other
8 stars 2 forks source link

Installing with PECL but have compile issue #2

Closed llaville closed 8 months ago

llaville commented 8 months ago

Hello,

To be honest, as I'm a newbie in C, I don't know if it's a real issue or not.

I've tried few minutes ago to install this imap extension from PECL, on a PHP 8.1.26 version (that of course have already imap bundled version)

php --ri

imap

IMAP c-Client Version => 2007f
SSL Support => enabled
Kerberos Support => enabled

Directive => Local Value => Master Value
imap.enable_insecure_rsh => Off => Off

Now with following command pecl install imap, and choose to disable kerberos and ssl support, I got this output (see ERROR at end) :

downloading imap-1.0.0.tgz ...
Starting to download imap-1.0.0.tgz (63,260 bytes)
................done: 63,260 bytes
6 source files, building
running: phpize
Configuring for:
PHP Api Version:         20210902
Zend Module Api No:      20210902
Zend Extension Api No:   420210902
Include Kerberos Support [yes] : no
Include SSL Support [yes] : no
building in /tmp/pear/temp/pear-build-rootFiSp0b/imap-1.0.0
running: /tmp/pear/temp/imap/configure --with-php-config=/usr/local/bin/php-config --with-kerberos=no --with-imap-ssl=no
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether cc accepts -g... yes
checking for cc option to enable C11 features... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking for system library directory... lib
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for PHP prefix... /usr/local
checking for PHP includes... -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/lib/php/extensions/no-debug-non-zts-20210902
checking for PHP installed headers prefix... /usr/local/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... gawk
checking for IMAP support... yes, shared
checking for IMAP Kerberos support... no
checking for IMAP SSL support... no
checking for utf8_mime2text signature... new
checking for U8T_DECOMPOSE... no
configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen. Check config.log for additional information.
ERROR: `/tmp/pear/temp/imap/configure --with-php-config=/usr/local/bin/php-config --with-kerberos=no --with-imap-ssl=no' failed
derickr commented 8 months ago

I am pretty sure this is not a bug, but follow the suggestion in the error message:

Check config.log for additional information.
llaville commented 8 months ago

I don't find any config.log file, and more than that

/tmp/
├── hsperfdata_root
└── pear
    ├── cache
    │   ├── 09c7a4116060de71a6a89c55a781511brest.cachefile
    │   ├── 09c7a4116060de71a6a89c55a781511brest.cacheid
    │   ├── 1af6566454b2ae1bb15cec0a285d07eerest.cachefile
    │   ├── 1af6566454b2ae1bb15cec0a285d07eerest.cacheid
    │   ├── 8ac57f69d71d859c4f5a971758531700rest.cachefile
    │   ├── 8ac57f69d71d859c4f5a971758531700rest.cacheid
    │   ├── e212497613ee5d3730a6c63e484fc656rest.cachefile
    │   └── e212497613ee5d3730a6c63e484fc656rest.cacheid
    ├── download
    │   └── imap-1.0.0.tgz
    └── temp

6 directories, 9 files

There is no /tmp/pear/temp/imap/configure available ! (/tmp/pear/tmp is empty)

derickr commented 8 months ago

You'll have to do the manual install to see the log:

pecl download imap
tar -xvzf imap-1.0.0.tgz
cd imap-1.0.0
phpize
./configure
llaville commented 8 months ago

Here is the result of my config.log 14kb (that I don't understand, sorry)

config.log ``` This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by configure, which was generated by GNU Autoconf 2.71. Invocation command line was $ ./configure ## --------- ## ## Platform. ## ## --------- ## hostname = php uname -m = x86_64 uname -r = 5.15.90.1-microsoft-standard-WSL2 uname -s = Linux uname -v = #1 SMP Fri Jan 27 02:56:13 UTC 2023 /usr/bin/uname -p = unknown /bin/uname -X = unknown /bin/arch = x86_64 /usr/bin/arch -k = unknown /usr/convex/getsysinfo = unknown /usr/bin/hostinfo = unknown /bin/machine = unknown /usr/bin/oslevel = unknown /bin/universe = unknown PATH: /usr/local/sbin/ PATH: /usr/local/bin/ PATH: /usr/sbin/ PATH: /usr/bin/ PATH: /sbin/ PATH: /bin/ PATH: /root/.composer/vendor/bin/ PATH: /usr/local/bin/ PATH: /usr/local/sbin/ PATH: /opt/nvm/versions/node//bin/ ## ----------- ## ## Core tests. ## ## ----------- ## configure:2505: looking for aux files: config.guess config.sub configure:2518: trying ./build/ configure:2547: ./build/config.guess found configure:2547: ./build/config.sub found configure:2664: checking for grep that handles long lines and -e configure:2728: result: /usr/bin/grep configure:2733: checking for egrep configure:2801: result: /usr/bin/grep -E configure:2806: checking for a sed that does not truncate output configure:2876: result: /usr/bin/sed configure:3020: checking for pkg-config configure:3043: found /usr/bin/pkg-config configure:3055: result: /usr/bin/pkg-config configure:3080: checking pkg-config is at least version 0.9.0 configure:3083: result: yes configure:3159: checking for cc configure:3180: found /usr/bin/cc configure:3191: result: cc configure:3222: checking for C compiler version configure:3231: cc --version >&5 cc (Debian 12.2.0-14) 12.2.0 Copyright (C) 2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. configure:3242: $? = 0 configure:3231: cc -v >&5 Using built-in specs. COLLECT_GCC=cc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/12/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Debian 12.2.0-14' --with-bugurl=file:///usr/share/doc/gcc-12/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-12 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-12-bTRWOB/gcc-12-12.2.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-12-bTRWOB/gcc-12-12.2.0/debian/tmp-gcn/usr --enable-offload-defaulted --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 12.2.0 (Debian 12.2.0-14) ... rest of stderr output deleted ... configure:3242: $? = 0 configure:3231: cc -V >&5 cc: error: unrecognized command-line option '-V' cc: fatal error: no input files compilation terminated. configure:3242: $? = 1 configure:3231: cc -qversion >&5 cc: error: unrecognized command-line option '-qversion'; did you mean '--version'? cc: fatal error: no input files compilation terminated. configure:3242: $? = 1 configure:3231: cc -version >&5 cc: error: unrecognized command-line option '-version' cc: fatal error: no input files compilation terminated. configure:3242: $? = 1 configure:3262: checking whether the C compiler works configure:3284: cc conftest.c >&5 configure:3288: $? = 0 configure:3338: result: yes configure:3341: checking for C compiler default output file name configure:3343: result: a.out configure:3349: checking for suffix of executables configure:3356: cc -o conftest conftest.c >&5 configure:3360: $? = 0 configure:3383: result: configure:3405: checking whether we are cross compiling configure:3413: cc -o conftest conftest.c >&5 configure:3417: $? = 0 configure:3424: ./conftest configure:3428: $? = 0 configure:3443: result: no configure:3448: checking for suffix of object files configure:3471: cc -c conftest.c >&5 configure:3475: $? = 0 configure:3497: result: o configure:3501: checking whether the compiler supports GNU C configure:3521: cc -c conftest.c >&5 configure:3521: $? = 0 configure:3531: result: yes configure:3542: checking whether cc accepts -g configure:3563: cc -c -g conftest.c >&5 configure:3563: $? = 0 configure:3607: result: yes configure:3627: checking for cc option to enable C11 features configure:3642: cc -c -g -O2 conftest.c >&5 configure:3642: $? = 0 configure:3660: result: none needed configure:3776: checking how to run the C preprocessor configure:3802: cc -E conftest.c configure:3802: $? = 0 configure:3817: cc -E conftest.c conftest.c:9:10: fatal error: ac_nonexistent.h: No such file or directory 9 | #include | ^~~~~~~~~~~~~~~~~~ compilation terminated. configure:3817: $? = 1 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "" | #define PACKAGE_TARNAME "" | #define PACKAGE_VERSION "" | #define PACKAGE_STRING "" | #define PACKAGE_BUGREPORT "" | #define PACKAGE_URL "" | /* end confdefs.h. */ | #include configure:3844: result: cc -E configure:3858: cc -E conftest.c configure:3858: $? = 0 configure:3873: cc -E conftest.c conftest.c:9:10: fatal error: ac_nonexistent.h: No such file or directory 9 | #include | ^~~~~~~~~~~~~~~~~~ compilation terminated. configure:3873: $? = 1 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "" | #define PACKAGE_TARNAME "" | #define PACKAGE_VERSION "" | #define PACKAGE_STRING "" | #define PACKAGE_BUGREPORT "" | #define PACKAGE_URL "" | /* end confdefs.h. */ | #include configure:3906: checking for icc configure:3916: result: no configure:3930: checking for suncc configure:3940: result: no configure:3958: checking for system library directory configure:3974: result: lib configure:3981: checking if compiler supports -Wl,-rpath, configure:4001: cc -o conftest -g -O2 conftest.c -Wl,-rpath,/usr/lib >&5 configure:4001: $? = 0 configure:4012: result: yes configure:4067: checking build system type configure:4082: result: x86_64-pc-linux-gnu configure:4102: checking host system type configure:4116: result: x86_64-pc-linux-gnu configure:4136: checking target system type configure:4150: result: x86_64-pc-linux-gnu configure:4254: checking for PHP prefix configure:4256: result: /usr/local configure:4258: checking for PHP includes configure:4260: result: -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib configure:4262: checking for PHP extension directory configure:4264: result: /usr/local/lib/php/extensions/no-debug-non-zts-20210902 configure:4266: checking for PHP installed headers prefix configure:4268: result: /usr/local/include/php configure:4271: checking if debug is enabled configure:4298: result: no configure:4301: checking if zts is enabled configure:4328: result: no configure:4396: checking for gawk configure:4418: found /usr/bin/gawk configure:4429: result: gawk configure:4482: checking for IMAP support configure:4523: result: yes, shared configure:4532: checking for IMAP Kerberos support configure:4548: result: no configure:4557: checking for IMAP SSL support configure:4573: result: no conftest.c:11:10: fatal error: /mail.h: No such file or directory 11 | #include | ^~~~~~~~~ compilation terminated. configure:4937: checking for utf8_mime2text signature configure:4960: cc -c -I conftest.c >&5 cc: fatal error: no input files compilation terminated. configure:4960: $? = 1 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "" | #define PACKAGE_TARNAME "" | #define PACKAGE_VERSION "" | #define PACKAGE_STRING "" | #define PACKAGE_BUGREPORT "" | #define PACKAGE_URL "" | #define COMPILE_DL_IMAP 1 | #define HAVE_IMAP 1 | /* end confdefs.h. */ | | #include | #include | | int | main (void) | { | | SIZEDTEXT *src, *dst; | utf8_mime2text(src, dst); | | ; | return 0; | } configure:4973: result: new configure:4984: checking for U8T_DECOMPOSE configure:5005: cc -c -I conftest.c >&5 cc: fatal error: no input files compilation terminated. configure:5005: $? = 1 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "" | #define PACKAGE_TARNAME "" | #define PACKAGE_VERSION "" | #define PACKAGE_STRING "" | #define PACKAGE_BUGREPORT "" | #define PACKAGE_URL "" | #define COMPILE_DL_IMAP 1 | #define HAVE_IMAP 1 | #define HAVE_NEW_MIME2TEXT 1 | /* end confdefs.h. */ | | #include | | int | main (void) | { | | int i = U8T_CANONICAL; | | ; | return 0; | } configure:5018: result: no configure:5023: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen. Check config.log for additional information. ## ---------------- ## ## Cache variables. ## ## ---------------- ## ac_cv_build=x86_64-pc-linux-gnu ac_cv_c_compiler_gnu=yes ac_cv_env_CC_set= ac_cv_env_CC_value= ac_cv_env_CFLAGS_set= ac_cv_env_CFLAGS_value= ac_cv_env_CPPFLAGS_set= ac_cv_env_CPPFLAGS_value= ac_cv_env_CPP_set= ac_cv_env_CPP_value= ac_cv_env_KERBEROS_CFLAGS_set= ac_cv_env_KERBEROS_CFLAGS_value= ac_cv_env_KERBEROS_LIBS_set= ac_cv_env_KERBEROS_LIBS_value= ac_cv_env_LDFLAGS_set= ac_cv_env_LDFLAGS_value= ac_cv_env_LIBS_set= ac_cv_env_LIBS_value= ac_cv_env_OPENSSL_CFLAGS_set= ac_cv_env_OPENSSL_CFLAGS_value= ac_cv_env_OPENSSL_LIBS_set= ac_cv_env_OPENSSL_LIBS_value= ac_cv_env_PKG_CONFIG_LIBDIR_set= ac_cv_env_PKG_CONFIG_LIBDIR_value= ac_cv_env_PKG_CONFIG_PATH_set= ac_cv_env_PKG_CONFIG_PATH_value= ac_cv_env_PKG_CONFIG_set= ac_cv_env_PKG_CONFIG_value= ac_cv_env_build_alias_set= ac_cv_env_build_alias_value= ac_cv_env_host_alias_set= ac_cv_env_host_alias_value= ac_cv_env_target_alias_set= ac_cv_env_target_alias_value= ac_cv_host=x86_64-pc-linux-gnu ac_cv_objext=o ac_cv_path_EGREP='/usr/bin/grep -E' ac_cv_path_GREP=/usr/bin/grep ac_cv_path_SED=/usr/bin/sed ac_cv_path_ac_pt_PKG_CONFIG=/usr/bin/pkg-config ac_cv_prog_AWK=gawk ac_cv_prog_CPP='cc -E' ac_cv_prog_ac_ct_CC=cc ac_cv_prog_cc_c11= ac_cv_prog_cc_g=yes ac_cv_prog_cc_stdc= ac_cv_target=x86_64-pc-linux-gnu ac_cv_u8t_decompose=no ac_cv_utf8_mime2text=new php_cv_cc_rpath=yes ## ----------------- ## ## Output variables. ## ## ----------------- ## AR='' AWK='gawk' BUILD_CC='' CC='cc' CFLAGS='-g -O2' CONFIGURE_COMMAND=' '\''./configure'\'' ' CONFIGURE_OPTIONS='' CPP='cc -E' CPPFLAGS='' DEFS='' DSYMUTIL='' ECHO='echo' ECHO_C='' ECHO_N='-n' ECHO_T='' EGREP='/usr/bin/grep -E' EXEEXT='' GREP='/usr/bin/grep' KERBEROS_CFLAGS='' KERBEROS_LIBS='' LDFLAGS='' LIBOBJS='' LIBS='' LIBTOOL='' LN_S='' LTLIBOBJS='' NMEDIT='' OBJEXT='o' OPENSSL_CFLAGS='' OPENSSL_LIBS='' PACKAGE_BUGREPORT='' PACKAGE_NAME='' PACKAGE_STRING='' PACKAGE_TARNAME='' PACKAGE_URL='' PACKAGE_VERSION='' PATH_SEPARATOR=':' PKG_CONFIG='/usr/bin/pkg-config' PKG_CONFIG_LIBDIR='' PKG_CONFIG_PATH='' RANLIB='' SED='/usr/bin/sed' SHELL='/bin/bash' SHLIB_DL_SUFFIX_NAME='so' SHLIB_SUFFIX_NAME='so' STRIP='' ac_ct_CC='cc' bindir='${exec_prefix}/bin' build='x86_64-pc-linux-gnu' build_alias='' build_cpu='x86_64' build_os='linux-gnu' build_vendor='pc' datadir='${datarootdir}' datarootdir='${prefix}/share' docdir='${datarootdir}/doc/${PACKAGE}' dvidir='${docdir}' exec_prefix='NONE' host='x86_64-pc-linux-gnu' host_alias='x86_64-pc-linux-gnu' host_cpu='x86_64' host_os='linux-gnu' host_vendor='pc' htmldir='${docdir}' includedir='${prefix}/include' infodir='${datarootdir}/info' libdir='${exec_prefix}/lib' libexecdir='${exec_prefix}/libexec' localedir='${datarootdir}/locale' localstatedir='${prefix}/var' mandir='${datarootdir}/man' oldincludedir='/usr/include' pdfdir='${docdir}' prefix='/usr/local' program_transform_name='s,x,x,' psdir='${docdir}' runstatedir='${localstatedir}/run' sbindir='${exec_prefix}/sbin' sharedstatedir='${prefix}/com' sysconfdir='${prefix}/etc' target='x86_64-pc-linux-gnu' target_alias='' target_cpu='x86_64' target_os='linux-gnu' target_vendor='pc' ## ----------- ## ## confdefs.h. ## ## ----------- ## /* confdefs.h */ #define PACKAGE_NAME "" #define PACKAGE_TARNAME "" #define PACKAGE_VERSION "" #define PACKAGE_STRING "" #define PACKAGE_BUGREPORT "" #define PACKAGE_URL "" #define COMPILE_DL_IMAP 1 #define HAVE_IMAP 1 #define HAVE_NEW_MIME2TEXT 1 configure: exit 1 ```
derickr commented 8 months ago

I now remember that I had a similar problem. The problem is that the build system can not find the c-client installed on your system.

You can see that in:

configure:4960: cc -c -I  conftest.c >&5

Where it should be:

configure:4960: cc -c -I/usr/include/c-client  conftest.c >&5

The build system expects a mail.h and c-client.h file in one of the following directories:

/usr/local/include/c-client
/usr/local/include/imap
/usr/local/include
/usr/local/imap
/usr/local/c-client
/usr/include/c-client
/usr/include/imap
/usr/include
/usr/imap
/usr/c-client

On my Debian system it finds /usr/include/c-client/mail.h, which is installed through the libc-client2007e-dev package. Installing that with apt-get should do the job.

llaville commented 8 months ago

After trying to install the libc-client requirement

root@php-8.1.27 in ~ $ apt-get update
Hit:1 http://deb.debian.org/debian bookworm InRelease
Hit:2 http://deb.debian.org/debian bookworm-updates InRelease
Hit:3 http://deb.debian.org/debian-security bookworm-security InRelease
Hit:4 https://packages.microsoft.com/debian/12/prod bookworm InRelease
Reading package lists... Done
root@php-8.1.27 in ~ $ apt-get install libc-client-dev -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'libc-client2007e-dev' instead of 'libc-client-dev'
libc-client2007e-dev is already the newest version (8:2007f~dfsg-7+b2).
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

And trying to install imap without kerberos and ssl support by answering to questions

Include Kerberos Support [yes] : no
Include SSL Support [yes] : no

I got this error

configure: error: This c-client library is built with Kerberos support.

      Add --with-kerberos to your configure line. Check config.log for details.

ERROR: `/tmp/pear/temp/imap/configure --with-php-config=/usr/local/bin/php-config --with-kerberos=no --with-imap-ssl=no' failed

So I've let down this possibility and try to install imap with kerberos and ssl support, but I got these errors

pecl install imap ``` root@php-8.1.27 in ~ $ pecl install imap downloading imap-1.0.0.tgz ... Starting to download imap-1.0.0.tgz (63,260 bytes) ................done: 63,260 bytes 6 source files, building running: phpize Configuring for: PHP Api Version: 20210902 Zend Module Api No: 20210902 Zend Extension Api No: 420210902 Include Kerberos Support [yes] : Include SSL Support [yes] : building in /tmp/pear/temp/pear-build-rootcsMPL9/imap-1.0.0 running: /tmp/pear/temp/imap/configure --with-php-config=/usr/local/bin/php-config --with-kerberos --with-imap-ssl checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for a sed that does not truncate output... /usr/bin/sed checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for cc... cc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether the compiler supports GNU C... yes checking whether cc accepts -g... yes checking for cc option to enable C11 features... none needed checking how to run the C preprocessor... cc -E checking for icc... no checking for suncc... no checking for system library directory... lib checking if compiler supports -Wl,-rpath,... yes checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-pc-linux-gnu checking target system type... x86_64-pc-linux-gnu checking for PHP prefix... /usr/local checking for PHP includes... -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib checking for PHP extension directory... /usr/local/lib/php/extensions/no-debug-non-zts-20210902 checking for PHP installed headers prefix... /usr/local/include/php checking if debug is enabled... no checking if zts is enabled... no checking for gawk... gawk checking for IMAP support... yes, shared checking for IMAP Kerberos support... yes checking for IMAP SSL support... yes checking for utf8_mime2text signature... new checking for U8T_DECOMPOSE... yes checking for pam_start in -lpam... yes checking for crypt in -lcrypt... yes checking for krb5-gssapi krb5... yes checking for openssl >= 1.0.2... yes checking for utf8_to_mutf7... yes checking whether rfc822_output_address_list function present... yes checking whether build with IMAP works... yes checking for a sed that does not truncate output... /usr/bin/sed checking for ld used by cc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking whether ln -s works... yes checking how to recognize dependent libraries... pass_all checking for stdio.h... yes checking for stdlib.h... yes checking for string.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for strings.h... yes checking for sys/stat.h... yes checking for sys/types.h... yes checking for unistd.h... yes checking for dlfcn.h... yes checking the maximum length of command line arguments... 1572864 checking command to parse /usr/bin/nm -B output from cc object... ok checking for objdir... .libs checking for ar... ar checking for ranlib... ranlib checking for strip... strip checking if cc supports -fno-rtti -fno-exceptions... no checking for cc option to produce PIC... -fPIC checking if cc PIC flag -fPIC works... yes checking if cc static flag -static works... yes checking if cc supports -c -o file.o... yes checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no creating libtool appending configuration tag "CXX" to libtool configure: patching config.h.in configure: creating ./config.status config.status: creating config.h running: make /bin/bash /tmp/pear/temp/pear-build-rootcsMPL9/imap-1.0.0/libtool --mode=compile cc -I. -I/tmp/pear/temp/imap -I/tmp/pear/temp/pear-build-rootcsMPL9/imap-1.0.0/include -I/tmp/pear/temp/pear-build-rootcsMPL9/imap-1.0.0/main -I/tmp/pear/temp/imap -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/c-client -I/usr/include/c-client -DHAVE_CONFIG_H -g -O2 -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -DZEND_COMPILE_DL_EXT=1 -c /tmp/pear/temp/imap/php_imap.c -o php_imap.lo -MMD -MF php_imap.dep -MT php_imap.lo mkdir .libs cc -I. -I/tmp/pear/temp/imap -I/tmp/pear/temp/pear-build-rootcsMPL9/imap-1.0.0/include -I/tmp/pear/temp/pear-build-rootcsMPL9/imap-1.0.0/main -I/tmp/pear/temp/imap -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/c-client -I/usr/include/c-client -DHAVE_CONFIG_H -g -O2 -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -DZEND_COMPILE_DL_EXT=1 -c /tmp/pear/temp/imap/php_imap.c -MMD -MF php_imap.dep -MT php_imap.lo -fPIC -DPIC -o .libs/php_imap.o In file included from /tmp/pear/temp/imap/php_imap.c:48: /tmp/pear/temp/imap/php_imap.h:50:32: error: expected declaration specifiers or ‘...’ before string constant 50 | ZEND_DIAGNOSTIC_IGNORED_START("-Wstrict-prototypes") | ^~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c-client/c-client.h:41, from /tmp/pear/temp/imap/php_imap.h:51: /usr/include/c-client/mail.h:636:13: error: field ‘text’ has incomplete type 636 | SIZEDTEXT text; /* string text */ | ^~~~ /usr/include/c-client/mail.h:750:13: error: field ‘text’ has incomplete type 750 | SIZEDTEXT text; /* text */ | ^~~~ /usr/include/c-client/mail.h:914:13: error: field ‘line’ has incomplete type 914 | SIZEDTEXT line; /* header line */ | ^~~~ /usr/include/c-client/mail.h:915:13: error: field ‘text’ has incomplete type 915 | SIZEDTEXT text; /* text in header */ | ^~~~ /usr/include/c-client/mail.h:1133:13: error: field ‘text’ has incomplete type 1133 | SIZEDTEXT text; /* scratch buffer for text */ | ^~~~ /tmp/pear/temp/imap/php_imap.h:52:29: error: expected ‘;’ before ‘typedef’ 52 | ZEND_DIAGNOSTIC_IGNORED_END | ^ | ; /tmp/pear/temp/imap/php_imap.h:91:19: error: field ‘text’ has incomplete type 91 | SIZEDTEXT text; | ^~~~ /tmp/pear/temp/imap/php_imap.h:98:19: error: field ‘text’ has incomplete type 98 | SIZEDTEXT text; | ^~~~ In file included from /usr/local/include/php/Zend/zend.h:32, from /usr/local/include/php/main/php.h:31, from /tmp/pear/temp/imap/php_imap.c:34: /tmp/pear/temp/imap/php_imap_arginfo.h: In function ‘register_php_imap_symbols’: /tmp/pear/temp/imap/php_imap_arginfo.h:605:134: error: ‘ZEND_STR_SENSITIVEPARAMETER’ undeclared (first use in this function) 605 | zend_add_parameter_attribute(zend_hash_str_find_ptr(CG(function_table), "imap_open", sizeof("imap_open") - 1), 2, ZSTR_KNOWN(ZEND_STR_SENSITIVEPARAMETER), 0); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/local/include/php/Zend/zend_string.h:86:44: note: in definition of macro ‘ZSTR_KNOWN’ 86 | #define ZSTR_KNOWN(idx) zend_known_strings[idx] | ^~~ /tmp/pear/temp/imap/php_imap_arginfo.h:605:134: note: each undeclared identifier is reported only once for each function it appears in 605 | zend_add_parameter_attribute(zend_hash_str_find_ptr(CG(function_table), "imap_open", sizeof("imap_open") - 1), 2, ZSTR_KNOWN(ZEND_STR_SENSITIVEPARAMETER), 0); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/local/include/php/Zend/zend_string.h:86:44: note: in definition of macro ‘ZSTR_KNOWN’ 86 | #define ZSTR_KNOWN(idx) zend_known_strings[idx] | ^~~ /tmp/pear/temp/imap/php_imap.c: In function ‘zif_imap_utf8’: /tmp/pear/temp/imap/php_imap.c:2219:19: error: storage size of ‘src’ isn’t known 2219 | SIZEDTEXT src, dest; | ^~~ /tmp/pear/temp/imap/php_imap.c:2219:24: error: storage size of ‘dest’ isn’t known 2219 | SIZEDTEXT src, dest; | ^~~~ /tmp/pear/temp/imap/php_imap.c: In function ‘zif_imap_mail_compose’: /tmp/pear/temp/imap/php_imap.c:3329:41: warning: implicit declaration of function ‘zend_zval_value_name’; did you mean ‘zend_zval_type_name’? [-Wimplicit-function-declaration] 3329 | zend_zval_value_name(data)); | ^~~~~~~~~~~~~~~~~~~~ | zend_zval_type_name /tmp/pear/temp/imap/php_imap.c:3366:41: warning: implicit declaration of function ‘ZEND_HASH_MAP_FOREACH_STR_KEY_VAL’; did you mean ‘ZEND_HASH_FOREACH_STR_KEY_VAL’? [-Wimplicit-function-declaration] 3366 | ZEND_HASH_MAP_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(pvalue), key, disp_data) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ZEND_HASH_FOREACH_STR_KEY_VAL /tmp/pear/temp/imap/php_imap.c:3366:110: error: expected ‘;’ before ‘{’ token 3366 | ZEND_HASH_MAP_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(pvalue), key, disp_data) { | ^~ | ; /tmp/pear/temp/imap/php_imap.c:3406:110: error: expected ‘;’ before ‘{’ token 3406 | ZEND_HASH_MAP_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(pvalue), key, disp_data) { | ^~ | ; /tmp/pear/temp/imap/php_imap.c:3421:25: error: expected ‘while’ before ‘if’ 3421 | if (bod->type == TYPEMESSAGE && bod->subtype && !strcmp(bod->subtype, "RFC822")) { | ^~ /tmp/pear/temp/imap/php_imap.c:3423:27: error: ‘else’ without a previous ‘if’ 3423 | } else { | ^~~~ /tmp/pear/temp/imap/php_imap.c:3443:33: error: label ‘done’ used but not defined 3443 | CHECK_HEADER_INJECTION(Z_STR_P(pvalue), 0, "body md5"); | ^~~~~~~~~~~~~~~~~~~~~~ /tmp/pear/temp/imap/php_imap.c: At top level: /tmp/pear/temp/imap/php_imap.c:3446:19: error: expected identifier or ‘(’ before ‘else’ 3446 | } else if (Z_TYPE_P(data) == IS_ARRAY && topbod->type == TYPEMULTIPART) { | ^~~~ /tmp/pear/temp/imap/php_imap.c:3502:25: error: expected identifier or ‘(’ before ‘}’ token 3502 | } | ^ /tmp/pear/temp/imap/php_imap.c:3503:25: error: expected identifier or ‘(’ before ‘if’ 3503 | if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "subtype", sizeof("subtype") - 1)) != NULL) { | ^~ /tmp/pear/temp/imap/php_imap.c:3508:25: error: expected identifier or ‘(’ before ‘if’ 3508 | if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "id", sizeof("id") - 1)) != NULL) { | ^~ /tmp/pear/temp/imap/php_imap.c:3513:25: error: expected identifier or ‘(’ before ‘if’ 3513 | if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "description", sizeof("description") - 1)) != NULL) { | ^~ /tmp/pear/temp/imap/php_imap.c:3518:25: error: expected identifier or ‘(’ before ‘if’ 3518 | if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "disposition.type", sizeof("disposition.type") - 1)) != NULL) { | ^~ /tmp/pear/temp/imap/php_imap.c:3524:25: error: expected identifier or ‘(’ before ‘if’ 3524 | if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "disposition", sizeof("disposition") - 1)) != NULL) { | ^~ In file included from /usr/local/include/php/Zend/zend.h:33: /usr/local/include/php/Zend/zend_hash.h:989:11: error: expected identifier or ‘(’ before ‘while’ 989 | } while (0) | ^~~~~ /tmp/pear/temp/imap/php_imap.c:3539:43: note: in expansion of macro ‘ZEND_HASH_FOREACH_END’ 3539 | } ZEND_HASH_FOREACH_END(); | ^~~~~~~~~~~~~~~~~~~~~ /tmp/pear/temp/imap/php_imap.c:3540:44: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘->’ token 3540 | bod->disposition.parameter = disp_param; | ^~ /tmp/pear/temp/imap/php_imap.c:3541:33: error: expected identifier or ‘(’ before ‘}’ token 3541 | } | ^ /tmp/pear/temp/imap/php_imap.c:3542:25: error: expected identifier or ‘(’ before ‘}’ token 3542 | } | ^ /tmp/pear/temp/imap/php_imap.c:3543:25: error: expected identifier or ‘(’ before ‘if’ 3543 | if (bod->type == TYPEMESSAGE && bod->subtype && !strcmp(bod->subtype, "RFC822")) { | ^~ /tmp/pear/temp/imap/php_imap.c:3545:27: error: expected identifier or ‘(’ before ‘else’ 3545 | } else { | ^~~~ /tmp/pear/temp/imap/php_imap.c:3557:25: error: expected identifier or ‘(’ before ‘if’ 3557 | if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "lines", sizeof("lines") - 1)) != NULL) { | ^~ /tmp/pear/temp/imap/php_imap.c:3560:25: error: expected identifier or ‘(’ before ‘if’ 3560 | if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "bytes", sizeof("bytes") - 1)) != NULL) { | ^~ /tmp/pear/temp/imap/php_imap.c:3563:25: error: expected identifier or ‘(’ before ‘if’ 3563 | if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "md5", sizeof("md5") - 1)) != NULL) { | ^~ /tmp/pear/temp/imap/php_imap.c:3568:17: error: expected identifier or ‘(’ before ‘}’ token 3568 | } | ^ /tmp/pear/temp/imap/php_imap.c:3569:9: error: expected identifier or ‘(’ before ‘}’ token 3569 | } ZEND_HASH_FOREACH_END(); | ^ /usr/local/include/php/Zend/zend_hash.h:988:17: error: expected identifier or ‘(’ before ‘}’ token 988 | } \ | ^ /tmp/pear/temp/imap/php_imap.c:3569:11: note: in expansion of macro ‘ZEND_HASH_FOREACH_END’ 3569 | } ZEND_HASH_FOREACH_END(); | ^~~~~~~~~~~~~~~~~~~~~ /usr/local/include/php/Zend/zend_hash.h:989:9: error: expected identifier or ‘(’ before ‘}’ token 989 | } while (0) | ^ /tmp/pear/temp/imap/php_imap.c:3569:11: note: in expansion of macro ‘ZEND_HASH_FOREACH_END’ 3569 | } ZEND_HASH_FOREACH_END(); | ^~~~~~~~~~~~~~~~~~~~~ /usr/local/include/php/Zend/zend_hash.h:989:11: error: expected identifier or ‘(’ before ‘while’ 989 | } while (0) | ^~~~~ /tmp/pear/temp/imap/php_imap.c:3569:11: note: in expansion of macro ‘ZEND_HASH_FOREACH_END’ 3569 | } ZEND_HASH_FOREACH_END(); | ^~~~~~~~~~~~~~~~~~~~~ /tmp/pear/temp/imap/php_imap.c:3571:9: error: expected identifier or ‘(’ before ‘if’ 3571 | if (bod && bod->type == TYPEMULTIPART && (!bod->nested.part || !bod->nested.part->next)) { | ^~ /tmp/pear/temp/imap/php_imap.c:3577:9: warning: data definition has no type or storage class 3577 | rfc822_encode_body_7bit(env, topbod); | ^~~~~~~~~~~~~~~~~~~~~~~ /tmp/pear/temp/imap/php_imap.c:3577:9: warning: type defaults to ‘int’ in declaration of ‘rfc822_encode_body_7bit’ [-Wimplicit-int] /tmp/pear/temp/imap/php_imap.c:3577:9: warning: parameter names (without types) in function declaration /tmp/pear/temp/imap/php_imap.c:3577:9: error: conflicting types for ‘rfc822_encode_body_7bit’; have ‘int()’ In file included from /usr/include/c-client/c-client.h:43: /usr/include/c-client/rfc822.h:99:6: note: previous declaration of ‘rfc822_encode_body_7bit’ with type ‘void(ENVELOPE *, struct mail_bodystruct *)’ {aka ‘void(struct mail_envelope *, struct mail_bodystruct *)’} 99 | void rfc822_encode_body_7bit (ENVELOPE *env,BODY *body); | ^~~~~~~~~~~~~~~~~~~~~~~ /tmp/pear/temp/imap/php_imap.c:3579:9: warning: data definition has no type or storage class 3579 | tmp = emalloc(SENDBUFLEN + 1); | ^~~ /tmp/pear/temp/imap/php_imap.c:3579:9: warning: type defaults to ‘int’ in declaration of ‘tmp’ [-Wimplicit-int] In file included from /usr/local/include/php/Zend/zend.h:30: /usr/local/include/php/Zend/zend_alloc.h:110:9: warning: initialization of ‘int’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion] 110 | (__builtin_constant_p(size) ? \ | ^ /usr/local/include/php/Zend/zend_alloc.h:157:65: note: in expansion of macro ‘_emalloc’ 157 | #define emalloc(size) _emalloc((size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) | ^~~~~~~~ /tmp/pear/temp/imap/php_imap.c:3579:15: note: in expansion of macro ‘emalloc’ 3579 | tmp = emalloc(SENDBUFLEN + 1); | ^~~~~~~ /usr/local/include/php/Zend/zend_alloc.h:110:9: error: initializer element is not constant 110 | (__builtin_constant_p(size) ? \ | ^ /usr/local/include/php/Zend/zend_alloc.h:157:65: note: in expansion of macro ‘_emalloc’ 157 | #define emalloc(size) _emalloc((size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) | ^~~~~~~~ /tmp/pear/temp/imap/php_imap.c:3579:15: note: in expansion of macro ‘emalloc’ 3579 | tmp = emalloc(SENDBUFLEN + 1); | ^~~~~~~ /tmp/pear/temp/imap/php_imap.c:3581:9: warning: data definition has no type or storage class 3581 | rfc822_header(tmp, env, topbod); | ^~~~~~~~~~~~~ /tmp/pear/temp/imap/php_imap.c:3581:9: warning: type defaults to ‘int’ in declaration of ‘rfc822_header’ [-Wimplicit-int] /tmp/pear/temp/imap/php_imap.c:3581:9: warning: parameter names (without types) in function declaration /tmp/pear/temp/imap/php_imap.c:3581:9: error: conflicting types for ‘rfc822_header’; have ‘int()’ /usr/include/c-client/rfc822.h:111:6: note: previous declaration of ‘rfc822_header’ with type ‘void(char *, ENVELOPE *, struct mail_bodystruct *)’ {aka ‘void(char *, struct mail_envelope *, struct mail_bodystruct *)’} 111 | void rfc822_header (char *header,ENVELOPE *env,BODY *body); | ^~~~~~~~~~~~~ /tmp/pear/temp/imap/php_imap.c:3584:9: error: expected identifier or ‘(’ before ‘if’ 3584 | if (custom_headers_param) { | ^~ /tmp/pear/temp/imap/php_imap.c:3609:11: error: expected identifier or ‘(’ before ‘else’ 3609 | } else { | ^~~~ /tmp/pear/temp/imap/php_imap.c:3613:9: warning: data definition has no type or storage class 3613 | bod = topbod; | ^~~ /tmp/pear/temp/imap/php_imap.c:3613:9: warning: type defaults to ‘int’ in declaration of ‘bod’ [-Wimplicit-int] /tmp/pear/temp/imap/php_imap.c:3613:15: error: ‘topbod’ undeclared here (not in a function) 3613 | bod = topbod; | ^~~~~~ /tmp/pear/temp/imap/php_imap.c:3615:9: error: expected identifier or ‘(’ before ‘if’ 3615 | if (bod && bod->type == TYPEMULTIPART) { | ^~ /tmp/pear/temp/imap/php_imap.c:3660:11: error: expected identifier or ‘(’ before ‘else’ 3660 | } else if (bod) { | ^~~~ /tmp/pear/temp/imap/php_imap.c:3664:11: error: expected identifier or ‘(’ before ‘else’ 3664 | } else { | ^~~~ In file included from /usr/local/include/php/main/php.h:35: /usr/local/include/php/Zend/zend_API.h:736:27: error: expected identifier or ‘(’ before ‘do’ 736 | #define ZVAL_STRING(z, s) do { \ | ^~ /usr/local/include/php/Zend/zend_API.h:797:57: note: in expansion of macro ‘ZVAL_STRING’ 797 | #define RETVAL_STRING(s) ZVAL_STRING(return_value, s) | ^~~~~~~~~~~ /tmp/pear/temp/imap/php_imap.c:3670:9: note: in expansion of macro ‘RETVAL_STRING’ 3670 | RETVAL_STRING(tempstring); | ^~~~~~~~~~~~~ /usr/local/include/php/Zend/zend_API.h:739:11: error: expected identifier or ‘(’ before ‘while’ 739 | } while (0) | ^~~~~ /usr/local/include/php/Zend/zend_API.h:797:57: note: in expansion of macro ‘ZVAL_STRING’ 797 | #define RETVAL_STRING(s) ZVAL_STRING(return_value, s) | ^~~~~~~~~~~ /tmp/pear/temp/imap/php_imap.c:3670:9: note: in expansion of macro ‘RETVAL_STRING’ 3670 | RETVAL_STRING(tempstring); | ^~~~~~~~~~~~~ /usr/local/include/php/Zend/zend_alloc.h:161:80: error: expected declaration specifiers or ‘...’ before ‘(’ token 161 | #define efree(ptr) _efree((ptr) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) | ^ /tmp/pear/temp/imap/php_imap.c:3671:9: note: in expansion of macro ‘efree’ 3671 | efree(tempstring); | ^~~~~ /tmp/pear/temp/imap/php_imap.c:3672:5: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token 3672 | done: | ^ /tmp/pear/temp/imap/php_imap.c:3676:24: error: expected declaration specifiers or ‘...’ before ‘&’ token 3676 | mail_free_body(&topbod); | ^ /tmp/pear/temp/imap/php_imap.c:3677:28: error: expected declaration specifiers or ‘...’ before ‘&’ token 3677 | mail_free_envelope(&env); | ^ /tmp/pear/temp/imap/php_imap.c:3678:1: error: expected identifier or ‘(’ before ‘}’ token 3678 | } | ^ make: *** [Makefile:209: php_imap.lo] Error 1 ERROR: `make' failed ```
remicollet commented 8 months ago

imap extension is only compatible with PHP 8.3+

PHP Api Version: 20210902

This is PHP 8.1

remicollet commented 8 months ago

Notice: package.xml in git is OK https://github.com/php/pecl-mail-imap/blob/main/package.xml#L147 (min = 8.3.0) but package.xml in pecl tarball is wrong (min = 8.1.0)

llaville commented 8 months ago

After installing required lib, all seems ok with pecl install imap

apt-get install libc-client-dev -y
apt-get install libkrb5-dev -y

pecl install imap
derickr commented 8 months ago

Would you mind making a PR to the readme to document this?

llaville commented 8 months ago

Did your forget my comment about disabling support ?

And trying to install imap without kerberos and ssl support by answering to questions

Include Kerberos Support [yes] : no
Include SSL Support [yes] : no

I got this error


configure: error: This c-client library is built with Kerberos support.
  Add --with-kerberos to your configure line. Check config.log for details.

ERROR: `/tmp/pear/temp/imap/configure --with-php-config=/usr/local/bin/php-config --with-kerberos=no --with-imap-ssl=no' failed



I don't think if there is a workaround for that or if any other libraries that I don't know yet allow to compile `imap` without these supports 
derickr commented 8 months ago

We can't do much about this on the PHP (pecl extension) side, as it is how the system installed c-client has been built.

I suppose it is possible to compile your own c-client without kerberos/SSL support, but if the system installed c-client already links to it, you have to enable it for the extension too.