Skip to main content

PHP require() not working with cronjob executed scripts

Comments

3 comments

  • hipwebdesign
    Welp, I managed to trace this to an issue with my WP login authentication during the init action hook. Had nothing to do with require. Solved!
    0
  • anton_latvia
    How do you call php in cronjob? I suspect you should use full path to the PHP binary: /opt/cpanel/ea-php73/root/usr/bin/php -f /home/full/path/to/your/cron.file.php
    it might be, that you simply run different PHP version and something does not get executed. You should turn on email notifications of the cron output to your email. And if that still does not work, should start debugging if cron and php run at all, for example running "php -v" in cron and sending yourself output.
    0
  • cPanelLauren
    Glad to see you were able to resolve the issue though @hipwebdesign
    0

Please sign in to leave a comment.