Admin Panel > Emails > Settings has email fetching enabled. Fetch on auto-cron is disabled.
(I was troubleshooting while also writing this out, but I've reached a bit of a block despite having emails working again - below is my thought process).
/etc/crontab has the following entries relating to osTicket;
*/5 * * * * root /usr/bin/php /var/www/support/api/cron.php 2>&1 | /usr/bin/logger -t ost_cron
0 2 * * * root /usr/local/bin/ost-userimport 2>&1 | /usr/bin/logger -t ost-userimport
Viewed the /var/log/syslog file and I'm seeing this;
Jan 26 12:55:01 support-2 ost_cron: PHP Fatal error: Uncaught Error: Call to undefined function mysqli_init() in /var/www/support/include/mysqli.php:28
Jan 26 12:55:01 support-2 ost_cron: Stack trace:
Jan 26 12:55:01 support-2 ost_cron: #0 /var/www/support/bootstrap.php(205): db_connect()
Jan 26 12:55:01 support-2 ost_cron: #1 /var/www/support/main.inc.php(28): Bootstrap::connect()
Jan 26 12:55:01 support-2 ost_cron: #2 /var/www/support/api/api.inc.php(32): require_once('...')
Jan 26 12:55:01 support-2 ost_cron: #3 /var/www/support/api/cron.php(17): require('...')
Jan 26 12:55:01 support-2 ost_cron: #4 {main}
Jan 26 12:55:01 support-2 ost_cron: thrown in /var/www/support/include/mysqli.php on line 28
Looking into this, I determined that this line in the above file had this line if (!($__db = mysqli_init())) return NULL;
- so looking into that it looks like it's complaining about the MySQLi extension is not installed or enabled on the server. Considering I've upgraded from older PHP7 to PHP8 for this osTicket upgrade, I figured some configuration would have been affected.
Navigating to /etc/php/8.2/cli/php.ini
and uncommenting extension=mysqli
to enable it... and even after restarting apache it's saying it can't find it.
Jan 26 13:20:01 support-2 ost_cron: PHP Warning: PHP Startup: Unable to load dynamic library 'mysqli' (tried: /usr/lib/php/20220829/mysqli (/usr/lib/php/20220829/mysqli: cannot open shared object file: No such file or directory), /usr/lib/php/20220829/mysqli.so (/usr/lib/php/20220829/mysqli.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
Everywhere I'm reading seems to indicate that it should be included though... so I installed the extension manually;
sudo apt-get install php-mysql
And I'm getting
CRON[1652]: (root) CMD (/usr/bin/php /var/www/support/api/cron.php 2>&1 | /usr/bin/logger -t ost_cron)
Jan 26 13:35:01 support-2 ost_cron: PHP Warning: PHP Startup: Unable to load dynamic library 'mysqli' (tried: /usr/lib/php/20220829/mysqli (/usr/lib/php/20220829/mysqli: cannot open shared object file: No such file or directory), /usr/lib/php/20220829/mysqli.so (/usr/lib/php/20220829/mysqli.so: undefined symbol: mysqlnd_global_stats)) in Unknown on line 0
I seem to be getting emails though now... but is this error normal?