Cron Jobs Not Working, False PHP Warning?

Your software
My Mautic version is:
My PHP version is: 8.3.12
My Database type and version is: 10.11.10-MariaDB

Your problem
My problem is: Cron Jobs are set properly but not working.

These errors are showing in the log:

#1) When I try to run the Cron Job command from VPS terminal, it gives me the following error

PHP Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version “>= 8.1.0”. You are running 8.0.30. in /home/marketic.co/hi/vendor/composer/platform_check.php on line 24

- > But the Mautic System Info confirms the PHP Version 8.3.12

#2) Mautic Log file shows an error but it’s not related to Cron Jobs I guess, It was related to Inbox Monitoring setting (I have already fixed it).

I’m using CyberPanel on VPS

mautic.NOTICE: PHP Notice - PHP Request Shutdown: [CLOSED] IMAP connection broken (server response) (errflg=2) - in file Unknown - at line 0 {“hostname”:“panel.DOMAIN.com”,“pid”:142071}

Steps I have tried to fix the problem:

#1) Double-checked PHP version, it’s fine
#2) Cron Job Codes are fine as well

Please suggest, thank you!

What happens if you downgrade to 8.2?

Changed my PHP to 8.2 (and 8.1 as well), restarted PHP & VPS as well, still the same error

Command Used:

/usr/bin/php /home/mautic-path/bin/console mautic:campaigns:trigger

Error:

Your Composer dependencies require a PHP version ">= 8.1.0". You are running 8.0.30.

PHP Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.1.0". You are running 8.0.30. in /home/mautic-path/vendor/composer/platform_check.php on line 24

The vHost Conf & Mautic System Info shows 8.3 as well: path /usr/local/lsws/lsphp83/bin/lsphp

Aany idea?

Cannot be the case, that you are using php-cli on old version?
Or your web server doesn’t have the right fpm tied in?

CyberPanel is only a website that is meant to facilitate your life when it comes to website, ftp, ssh, dns and email management. It won’t do anything nor impact the web app in any way, shape or form. Same is true for shell scripting.

And you’re most likely using the wrong PHP version, as your logs are reporting.

Doubting me? No worries, all good!

As the saying goes: Don’t trust. Verify.

How to Verify?

  1. Drop to the shell
  2. Type the following
    php --version

What happened?
You are most likely running a bourne again shell during your shell session.
You are most likely running a LiteSpeed WebServer in hyper text.

In other words, you assumed that your web server was using the same binary that your shell. And from there refused to doubt yourself…

How to use the proper version?
You’ll have to check the CyberPanel user manual (the end-user one. This isn’t requiring any kind of privilege).

Good to know…

  • It’s possible to install and use multiple PHP version, at the same time.
  • There’s a difference between the web interpreter and the CLI interpreter (PHP is an interpreter).
  • Web server management GUI like Webmin, cPanel, DirectAdmin, CyberPanel, etc…, are often installing multiple PHP version.

Hope it helped

1 Like

@joeyk I studied a post where you were talking about postal server and creating your own SMTP server, I created one, but I have a question, where could I buy IPs to rotate the IPs on the postal server?

Your ISP is the only one who can provide you an extra CIDR

Yes it helped, and I have managed to install & assign PHP 8.3 to my Mautic instance.

Thank you for your suggestions.

BUT the cron jobs are still not running, here is the top error I got after running command

An exception occurred while establishing a connection to figure out your platform version.
You can circumvent this by setting a ‘server_version’ configuration value

For further information have a look at:
BC break between 1.6.7 -> 1.6.8 regarding driver selection · Issue #673 · doctrine/DoctrineBundle · GitHub

In ExceptionConverter.php line 117:
An exception occurred in the driver: could not find driver

In Exception.php line 28:
could not find driver

In Driver.php line 33:
could not find driver

And here is the Mautic Log

`

[2025-01-10T11:34:03.071165+00:00] mautic.ERROR: Doctrine\DBAL\Exception: An exception occurred while establishing a connection to figure out your platform version. You can circumvent this by setting a 'server_version' configuration value For further information have a look at: https://github.com/doctrine/DoctrineBundle/issues/673 (uncaught exception) at /home/mautic-path/vendor/doctrine/doctrine-bundle/ConnectionFactory.php line 183 while running console command UNKNOWN [stack trace] #0 /home/mautic-path/vendor/doctrine/doctrine-bundle/ConnectionFactory.php(157): Doctrine\Bundle\DoctrineBundle\ConnectionFactory->getDatabasePlatform() #1 /home/mautic-path/var/cache/prod/ContainerXW3KIGl/AppKernelProdContainer.php(4966): Doctrine\Bundle\DoctrineBundle\ConnectionFactory->createConnection() #2 /home/mautic-path/var/cache/prod/ContainerXW3KIGl/AppKernelProdContainer.php(4976): ContainerXW3KIGl\AppKernelProdContainer->getDoctrine_Dbal_DefaultConnectionService() #3 /home/mautic-path/var/cache/prod/ContainerXW3KIGl/AppKernelProdContainer.php(7803): ContainerXW3KIGl\AppKernelProdContainer->getDoctrine_Orm_DefaultEntityManagerService() #4 /home/mautic-path/var/cache/prod/ContainerXW3KIGl/AppKernelProdContainer.php(3890): ContainerXW3KIGl\AppKernelProdContainer->getMautic_Helper_IpLookupService() #5 /home/mautic-path/var/cache/prod/ContainerXW3KIGl/AppKernelProdContainer.php(7297): ContainerXW3KIGl\AppKernelProdContainer->getEmailModelService() #6 /home/mautic-path/var/cache/prod/ContainerXW3KIGl/AppKernelProdContainer.php(9768): ContainerXW3KIGl\AppKernelProdContainer->getMautic_Email_Fixture_EmailService() #7 /home/mautic-path/var/cache/prod/ContainerXW3KIGl/getDoctrine_FixturesLoadCommandService.php(20): ContainerXW3KIGl\AppKernelProdContainer->getDoctrine_Fixtures_LoaderService() #8 /home/mautic-path/var/cache/prod/ContainerXW3KIGl/AppKernelProdContainer.php(2369): ContainerXW3KIGl\getDoctrine_FixturesLoadCommandService::do() #9 /home/mautic-path/vendor/symfony/dependency-injection/Container.php(428): ContainerXW3KIGl\AppKernelProdContainer->load() #10 /home/mautic-path/vendor/symfony/dependency-injection/Argument/ServiceLocator.php(42): Symfony\Component\DependencyInjection\Container->getService() #11 /home/mautic-path/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php(45): Symfony\Component\DependencyInjection\Argument\ServiceLocator->get() #12 /home/mautic-path/vendor/symfony/console/Application.php(596): Symfony\Component\Console\CommandLoader\ContainerCommandLoader->get() #13 /home/mautic-path/vendor/symfony/console/Application.php(792): Symfony\Component\Console\Application->has() #14 /home/mautic-path/vendor/symfony/framework-bundle/Console/Application.php(142): Symfony\Component\Console\Application->all() #15 /home/mautic-path/vendor/symfony/console/Application.php(609): Symfony\Bundle\FrameworkBundle\Console\Application->all() #16 /home/mautic-path/vendor/symfony/console/Application.php(633): Symfony\Component\Console\Application->getNamespaces() #17 /home/mautic-path/vendor/symfony/console/Application.php(701): Symfony\Component\Console\Application->findNamespace() #18 /home/mautic-path/vendor/symfony/framework-bundle/Console/Application.php(116): Symfony\Component\Console\Application->find() #19 /home/mautic-path/vendor/symfony/console/Application.php(259): Symfony\Bundle\FrameworkBundle\Console\Application->find() #20 /home/mautic-path/vendor/symfony/framework-bundle/Console/Application.php(82): Symfony\Component\Console\Application->doRun() #21 /home/mautic-path/vendor/symfony/console/Application.php(171): Symfony\Bundle\FrameworkBundle\Console\Application->doRun() #22 /home/mautic-path/bin/console(16): Symfony\Component\Console\Application->run() #23 {main} [] {"hostname":"panel.malikmerchant.com","pid":5976}

`

It look like PHP is missing some extensions.

Please run this cmd to see what is loaded:

php -r "print_r(get_loaded_extensions());"

From there, see if you have your MySQL extension.

1 Like

This is the outcome after running the command

Array
(
[0] => Core
[1] => date
[2] => libxml
[3] => openssl
[4] => pcre
[5] => zlib
[6] => filter
[7] => hash
[8] => json
[9] => pcntl
[10] => random
[11] => readline
[12] => Reflection
[13] => SPL
[14] => session
[15] => standard
[16] => sockets
[17] => bz2
[18] => calendar
[19] => ctype
[20] => curl
[21] => dom
[22] => mbstring
[23] => fileinfo
[24] => ftp
[25] => gd
[26] => gettext
[27] => iconv
[28] => exif
[29] => PDO
[30] => Phar
[31] => SimpleXML
[32] => sodium
[33] => sqlite3
[34] => tokenizer
[35] => xml
[36] => xmlwriter
[37] => xsl
[38] => pdo_sqlite
[39] => xmlreader
[40] => zip
[41] => Zend OPcache
)

1 Like

PDO (29) is loaded… But not PDO_MYSQL

Make sure to load it and you’ll be good to go.

1 Like