How can I use a choosen php.ini file for crontask?

219 Views Asked by At

I need your help. I would like to be able to automate actions that use the php imap extension (email fetching) so I am using a cron job (crontab on mac) but I got an error message when running the script: In Imap.php line 97: Undefined constant ‘OP_READONLY’

I think the error is because the php imap extension is not enabled for php command Line interface. So my question is, what can I do to use my php.ini (used for web server nginx) located in /usr/local/etc/php/7.4.10/. Furthermore I do php -v inside the cronjob task and it seems like the php version used is 7.3.18, so not the version of php I work with on web development. I work on Mac IOS 11 Big Sur (beta version) with nginx, php 7.4.10, php-fpm. Thank you in advance for your help

Regards, Killian

0

There are 0 best solutions below