Skip to main content
Errors

Magento – cron.sh error – /bin/nice: No such file or directory

By May 18, 2015No Comments

When trying to enable the default Magento cron job via CPanel, using either cron.sh or cron.php, I received the following run errors;

cron.sh error


 /bin/nice: /../../www/www/cron.sh: No such file or directory

 

cron.php error


/../../www/www/cron.php: line 1: ?php: No such file or directory
/../../www/www/cron.php: line 2: /**: No such file or directory
/../../www/www/cron.php: line 3: LICENSE.html: command not found
/../../www/www/cron.php: line 4: LICENSE.html: command not found
/../../www/www/cron.php: line 5: LICENSE.html: command not found
/../../www/www/cron.php: line 6: LICENSE.html: command not found
/../../www/www/cron.php: line 7: syntax error near unexpected token `('
/../../www/www/cron.php: line 7: ` * This source file is subject to the Open Software License (OSL 3.0)'

The permissions set on both cron files was correct, but still the files wouldn’t run.

php.ini file issue

After discussions with my hosting company, the issue was actually a module enabled in the php.ini file.


extension=mcrypt.so

Commenting out the above line fixed the issue, with the cron.sh file now executing without errors. The mcrypt module could safely be disabled as it was no longer deemed necessary; “PHP is already compiled with mcrypt, so there is no need to include this module.”

I hope this helps to get cron jobs running on your Magento install.

Andrew Taylor

A senior UI designer with over 25 years of web design and web development experience working for some of the largest companies in the UK. An expert in all things Magento and WordPress.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.