Issues with Cron Jobs with CentOS
04-11-2015, 12:48 PM
(This post was last modified: 04-11-2015, 12:50 PM by Kyle.)
Okay, I'm trying to scratch my head here why the cron jobs aren't working on CentOS 7.
This is what I did...
1) I checked to make sure that the directory /var/spool/cron is owned by apache:apache and with permissions 770 & /var/spool/cron/apache is owned by apache:apache and with permissions 660
2) I checked for trailing slashes and and made sure that there aren't slashes at the beginging of the file location field when adding cron jobs and setting it to run every minute.
So far, nothing seems to be executed or changes to my database. I had a code that should be changing fields in the database, I confirmed that it is working by running the file manually on URL. But the cron job isn't working for some reason.
So I decided to take a look into the /var/log/cron, it does seem the crons are being executed, but not actually being executed.
Apr 11 02:20:01 panel CROND[9536]: (apache) CMD (php -d suhosin.executor.func.blacklist="passthru, show_source, shell_exec, system, pcntl_exec, popen, pclose, proc_open, proc_nice, proc_terminate, proc_get_status, proc_close, leak, apache_child_terminate, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, posix_setuid, escapeshellcmd, escapeshellarg, exec" -d open_basedir="/var/sentora/hostdata/zadmin/:/var/sentora/temp/" /var/sentora/hostdata/zadmin/public_html/{URL_REMOVED}/cron_jobs/test.php)
So, this makes me wonder, there is an issue with running PHP on crons, or I'm not sure why?
Any ideas?
This is what I did...
1) I checked to make sure that the directory /var/spool/cron is owned by apache:apache and with permissions 770 & /var/spool/cron/apache is owned by apache:apache and with permissions 660
2) I checked for trailing slashes and and made sure that there aren't slashes at the beginging of the file location field when adding cron jobs and setting it to run every minute.
So far, nothing seems to be executed or changes to my database. I had a code that should be changing fields in the database, I confirmed that it is working by running the file manually on URL. But the cron job isn't working for some reason.
So I decided to take a look into the /var/log/cron, it does seem the crons are being executed, but not actually being executed.
Apr 11 02:20:01 panel CROND[9536]: (apache) CMD (php -d suhosin.executor.func.blacklist="passthru, show_source, shell_exec, system, pcntl_exec, popen, pclose, proc_open, proc_nice, proc_terminate, proc_get_status, proc_close, leak, apache_child_terminate, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, posix_setuid, escapeshellcmd, escapeshellarg, exec" -d open_basedir="/var/sentora/hostdata/zadmin/:/var/sentora/temp/" /var/sentora/hostdata/zadmin/public_html/{URL_REMOVED}/cron_jobs/test.php)
So, this makes me wonder, there is an issue with running PHP on crons, or I'm not sure why?
Any ideas?