Initially I had faced the same issue with my servers. Damn Its a nasty workaround. It took me 3 days to figure it out !
An old problem of the building process of PHP, since fixed. The problem is
happening because of
the incorrect compiling of PHP with libimap.a belonging to kde-pim or
something similar rather than
To correct this,
1. Rename /usr/lib/libimap.a and/or /usr/lib/libimap.so to a different name.
2. Recompile PHP
3. Rename the library in (1) to it's original name
[Non-text portions of this message have been removed]