Here's why I think you are getting that error:
mod_imap is an Apache module for server-side imagemap
processing not the IMAP protocol for manipulating mail.
In order to get the imap_open() functionality in
PHP you'll need to recompile PHP with the --with-imap option.
--with-imap requires c-client. See this manual page for a complete
explanation:
http://www.php.net/manual/en/ref.imap.php