It’s been a while, but I had to recompile a PHP from source and ran into this problem during the ./configure stage.
$ ./configure
...
checking for IMAP Kerberos support... no
checking for IMAP SSL support... yes
checking for utf8_mime2text signature... new
checking for U8T_DECOMPOSE...
configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing.
This should not happen. Check config.log for additional information.
To resolve that utf8_mime2text() has new signature, but U8T_CANONICAL is missing error, on CentOS you can install the libc-client-devel package.
$ yum install libc-client-devel
After that, your ./configure should go through.
One thing to keep in mind if you hit this in 2026: as of PHP 8.4 the IMAP extension is no longer part of PHP core, it was moved to PECL because the c-client library it relies on hasn’t been maintained in years. So you’ll only run into this error when building PHP 8.3 or older with --with-imap, or when building the imap PECL extension separately. The libc-client-devel fix is the same either way.