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

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, 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

  • 9 Users Found This Useful
Was this answer helpful?

Related Articles

How to create a Reseller WHM

You must have a VPS or Dedicated Server with root WHM to do this.1. Login to WHM and click the...

How do I backup my website?

1. Login to cPanel2. Click on Backups3. Click Download or Generate a Full Web Site Backup4....

How to reset a reseller's client's password

1. Go to WHM and click Password Modification (under Account Functions). 2. Select the account...

How to Backup & Restore MySQL Database in cPanel

To backup the databases please do the following:1. Login to your control panel and click...

How to Suspend and Unsuspend an account in WHM?

1) Login into your WHM control panel and click on the “Accounts Function”. 2) Scroll...

Powered by WHMCompleteSolution