cronjob execute different php version or mac os big sur Caused by: Exception 'PDOException' with message 'could not find driver'
Problem is solved: the cron job execution was using a different version of PHP. Different both from the one from Apache and from the one from the CLI. So I just used the explicit path, referencing the correct PHP version.
example cron using yii2
* */1 * * * /usr/bin/php /var/www/mysite/yii controller/actionThat should do the trick - provided that you supply the correct paths.
To find out what the full path to php is, run this in a console prompt:
which php
in this case, when cron running console always get error PDO exception
Komentar
Posting Komentar