i'm getting this cron install error, how can i fix it?thankyou!!

php bin/magento cron:install --force

Fatal error: Uncaught Error: Call to a member function getMessage() on null in /home/XXX/public_html/vendor/magento/framework/Crontab/CrontabManager.php:202

  • Did you try o run setup:di:compile before? Feb 10, 2018 at 20:30
  • Please use php bin/magento cron:run command to ensure cron is running in Magento after that you can set the cron Feb 11, 2018 at 4:28
  • yes,but can not, Fatal error @PurushotamSharma
    – niceonelee
    Feb 11, 2018 at 7:07
  • maybe no, so i need run setup:di:compile?thank you @Vulpea
    – niceonelee
    Feb 11, 2018 at 7:07
  • Hi @niceonelee, you've got any solution for this? I have the same error
    – chdzma
    Mar 31, 2020 at 14:06

1 Answer 1


The exception handler for the actual error is failing. It expects a previous exception, but there is none.

The actual error is the exec method being disabled by php.ini disabled_functions.

        $disabled = explode(',', str_replace(' ', ',', ini_get('disable_functions')));
        if (in_array('exec', $disabled)) {
            throw new Exception\LocalizedException(new \Magento\Framework\Phrase('The exec function is disabled.'));

Source: GitHub.com

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.