cPanel - Could not exec shell /bin/bash with errno = 2 Print

  • 3

If you are receiving alerts like the following regarding your cPanel cronjob's then this article will show you how to fix the issue:

Could not exec shell '/bin/bash' with errno = 2

In a recent update to the cPanel hosting system, all cronjob's were changed to run in jailed environments, thus any calls to bash related commands now need fully qualified paths.

So, for example if you were running a php command like:

php /path-to-my-script.php

It now needs to be changed to:

/usr/bin/php /path-to-my-script.php

Some common command paths are:

/usr/bin/php
/usr/bin/wget
/usr/bin/curl

If this article helped you out, please give it a like :)


Was this answer helpful?

« Back