向cron添加php脚本 [英] Adding php script to cron

查看:212
本文介绍了向cron添加php脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在将脚本添加到cron调度程序时,应将其作为脚本的网址。
脚本位于 domain.com/scripts/script.php < br>
PS:我正在使用cPanel

What should be given as the url to the script while adding it to cron scheduler.
The script is at domain.com/scripts/script.php
PS:I am using cPanel

推荐答案

/ p>

If you add the line

#!/usr/bin/php

到文件的开头(使用'which php'找出你的实际目录)并将文件mod改为executable,你应该能够通过调用like您的第二个选择,

to the beginning of your file (use 'which php' to find out your actual directory) and change the file mod to "executable", you should be able to run it just by calling like your second choice,

/public_html/scripts/script.php

我希望能为你工作。

这篇关于向cron添加php脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆