There are a few things that could be causing the issue:
-
Make sure that the cron job is actually running. You can check this by running the command
sudo grep CRON /var/log/syslogon your server. This will show you a list of all the cron jobs that have run recently. -
Make sure that the path to your PHP binary is correct. You can check this by running the command
which phpon your server. This will show you the path to the PHP binary that is being used. -
Make sure that the user that the cron job is running as has permission to execute the PHP file. You can check this by running the command
ls -l /home/app/app.example.com/cron.filename.phpon your server. This will show you the permissions for the file. -
Try running the command as the
appuser. You can do this by running the commandsudo -u app php /home/app/app.example.com/cron.filename.php. This will run the command as theappuser and should give you any errors that are being generated.
Here is an example of what the cron job command should look like:
* * * * * php /home/app/app.example.com/cron.filename.php >> /var/log/cron.log 2>&1
This will run the command every minute and log any output to the /var/log/cron.log file.