how to run php script automatically every minute without access to that page?

前端 未结 3 421
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-29 01:23

I\'m developing website that will send email back to user automatically when they registered to my website. I have searched from internet, most of them said that i have to used

3条回答
  •  萌比男神i
    2021-01-29 02:02

    If we assume that the script that you want to run is located at /home/me/myscript.php then all you need to do is create a cron job that will run that script every minute.

    Several hosting companies have an interface (cPanel for instance) that will allow you to add a cron task easily. You can also add the cron task by editing the relevant cron job and adding:

    */1 * * * * /usr/bin/php /home/me/myscript.php > /dev/null
    

提交回复
热议问题