cancel
Showing results for 
Search instead for 
Did you mean: 

Cron.php/Cron.sh Not being called - Permission problem

Re: Cron.php/Cron.sh Not being called - Permission problem

 

 I thought I'd add a fix for a CRON.sh issue I had in case someone comes across this thread and has a similar issue.

 

My shared/hosted server was calling my cron.sh file and for some unknown reason the cron.php files where never called. I could manually call the cron.php files and that worked. So after a few days of pounding my head against a wall I found out the Cron.sh script issues a `which php` command which should return (in my case) /usr/local/bin/php .  For some reason the command is returning an empty string so the script fails to execute the code to call the cron.php file.

I hard coded the variable in the cron.sh file and it fired right up.   So The crontab was working fine, the script is ok.. It was just the server was returning "" on the which php command.

Changes I made:

#PHP_BIN=`which php`
PHP_BIN="/usr/local/bin/php"

Your PHP location may be different.

 

The original post sounds like a permission issue.  You should be calling the cron.sh file which then will execute the .php files.  Since the server will be doing the executing the permission issue shouldn't come up.

 

 

Eric

Re: Cron.php/Cron.sh Not being called - Permission problem

Thanks for posting that Ericclay, I've been trying to get a similiar issue (cron script working from command line, but not in crontab) figured out for a day or two now and this fixed it.  I'm running Magento v1.9.2.2 on shared hosting with the AOE scheduler extension, so the line I replaced was located in scheduler_cron.sh:

 

# PHP_BIN=$(which php || true)
PHP_BIN="/usr/local/bin/php"

 

Re: Cron.php/Cron.sh Not being called - Permission problem

Thanks!

That Got it for Me Too

Re: Cron.php/Cron.sh Not being called - Permission problem

it works for me.  thank you!