Is it possible to set up a cron job that will execute a php script? And if so, what are the commands to do it?
which server you are using Linux or Windows and control panel?? to run a cron job you just need to point the cron the the script you are trying to execute..
Unix running Apache, and I'm using the standard cron manager in cPanel I'm trying this, if you don't hear back from me, then it's working php -q /home/blabla/public_html/blabla/cron.php
There is no $PATH in the crontab so you will need the full path to php. Something like /usr/local/bin/php. Alternatively, you can use a shebang line as the first line of your script that looks like this: #!/usr/local/bin/php Code (markup): The only other thing to be careful of is that the cron jobs will run as the user whose crontab they are in. If this user is root then you will want to write dropping permissions into your cron job. If it's running as you then your permissions will probably be fine. If you need it to run as the same user that Apache runs as then you will need to use su. sudo su www-data -c "/usr/local/bin/php /path/to/php/script/here.php" Code (markup):
You shouldn't need the full path to PHP, it should work fine without it. You do however need the full path to the script, which "/home/blabla/public_html/blabla/cron.php" is already set!