Bash script to run php script

前端 未结 9 644
悲&欢浪女
悲&欢浪女 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:03

    I'm pretty sure something like this is what you are looking for:

    #!/bin/sh
    
    php /pathToScript/script.php
    

    Save that with your desired script name (such as runPHP.sh) and give it execution rights, then you can use it however you want.

    Edit: You might as well not use a bash script at all and just add the "php ..." command to the crontab, if I'm not mistaken.

    Good luck!

提交回复
热议问题