Bash script to run php script

前端 未结 9 658
悲&欢浪女
悲&欢浪女 2020-12-07 20:30

I have a php script that I want to be run using a bash script, so I can use Cron to run the php script every minute or so.

As far as I\'m aware I need to create the

9条回答
  •  死守一世寂寞
    2020-12-07 21:07

    The bash script should be something like this:

    #!/bin/bash
    /usr/bin/php /path/to/php/file.php
    

    You need the php executable (usually found in /usr/bin) and the path of the php script to be ran. Now you only have to put this bash script on crontab and you're done!

提交回复
热议问题