ImapHandler::isAvailable function returns false

I’ve been having problems with the Check Inbound Mailboxes,

IMAP wrapper called: ImapHandler::isAvailable([])
IMAP wrappers return: ImapHandler::isAvailable(…) => false
------------------------- IMAP libraries NOT available!!! die()ing thread.----
Trying to connect to mailserver for [ Tickets ]
SCHEDULERS: could not get an IMAP connection resource for ID [ 42d58576-d15f-e132-65e3-566e34a39e00 ]. Skipping mailbox [ Tickets ].

public function isAvailable()
{
$this->logCall(FUNCTION, func_get_args());
$ret = function_exists(“imap_open”) && function_exists(“imap_timeout”);
$this->logReturn(FUNCTION, $ret);
return $ret;
}

but when I try to dump the value of : function_exists(“imap_open”) && function_exists(“imap_timeout”) in a separate file, both of them returns true.
I have no idea why it returns false when it is called in cron

I’m using SuiteCRM 7.10.18
Thanks in advance!

Hello,

It could be an issue of your server’s cronjobs may run in the different PHP version. The CLI and the web server like to use different versions of PHP unless you tell them not to.

Check your CLI version of PHP by

php --version
1 Like

I just found the cause of the problem this morning, I didn’t point the URL of the php that the site is using, that’s why cron is using the CLI version of PHP.

Cheers!!