Crons throwing PDOConnection error

Your software
My Mautic version is: v3.2.4
My PHP version is: 7.3.26
My Database type and version is: MariaDB version 10.5.8

Your problem
My problem is:
running segments:update or campaigns:update

PHP Fatal error: Declaration of Doctrine\DBAL\Driver\PDOConnection::query() must be compatible with PDO::query(string $query, ?int $fetchMode = null, mixed …$fetchModeArgs) in …/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php on line 70

These errors are showing in the log:
nothing regarding this in the Mautic Logs

Steps I have tried to fix the problem:

my_url/s/update/schema which says schema is up to date from browser

from command line:
php bin/console doctrine:migration:migrate
php bin/console doctrine:schema:update --force

which gives me same error as cron job.

Turned out PHP CLI version was V8, Apache was 7.3

1 Like

were you able to solve it? please help. having similar issue

^ The fix is here and marked as the solution to the post, for info @namratasaun

Actually, asked again because the correct version of php cli isn’t mentioned. I switched to 7.4 and it worked. Thank you