Anyone here that knows how to setup cron jobs in Plesk?
We just moved to a new VPS server where we use Plesk to partition the server into various functions.
I been sitting for several hours searching and testing and so far I had no success.
It just fails with the following:
**Task "public_html/cron.php" completed with error in 0 seconds, output:**
Task "public_html/cron.php" completed with error in 0 seconds, output:
PHP Fatal error: Uncaught TypeError: imap_expunge(): Argument #1 ($imap) must be of type resource, bool given in /var/www/vhosts/example-domain.com/public_html/include/Imap/ImapHandler.php:517
Stack trace:
#0 /var/www/vhosts/example-domain.com/public_html/include/Imap/ImapHandler.php(517): imap_expunge()
#1 /var/www/vhosts/example-domain.com/public_html/modules/Schedulers/_AddJobsHere.php(720): ImapHandler->expunge()
#2 /var/www/vhosts/example-domain.com/public_html/modules/SchedulersJobs/SchedulersJ.
The error seems to be inbound email. If you don’t need it, then disable that job, and the others should run fine. Keep an eye on Admin / Schedulers, enter each job and check “Last ran successfully” field to understand what’s happening.
If you need it, you need to figure out which part of the inbound email configuration is broken… which can be a tricky thing to do
That FATAL looks just like the IMAP errors that people are getting with the new changes in Microsoft Accounts. It simply looks like the job that grabs email is unable to do so (and unable to fail gracefully)
I found a solution @pgr.
It all came down to the allowed user for cron jobs.
I created this file and called it test.php (Saved it in www root), and added this code:
<?php
echo get_current_user();
after that ran the test.php file in the browser which then prints the current user used for the cron jobs and changed it in the config.php file to that user.