i have a php script that should be run automatically every day.
as the php script is run on a request,how can i do it?
is there any way else using cronjob task?
i have a php script that should be run automatically every day. as the
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Two options:
The choice is yours 🙂
To use crontab, type
crontab -ein console, the text file opens. Add a line at the end:Where:
0 0 * * *– run every day at 00:00/usr/bin/php-path to your PHP (can be determined bywhich phpcommand)/var/www/mysite/httpdocs/daily_stats.php– path to your PHP scriptif
which phpoutputs nothing, install PHP cli by running:Good luck!