如何在cron中运行php脚本 [英] How to run a php script in cron

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

问题描述

我发现很多问题和文章,但我仍然有一些困难。
我使用以下命令
/ usr / bin / php home / domain.com / public_html / cron / script.php
我收到以下错误
状态:404未找到
X-Powered-By:PHP / 5.2.8
Content-type:text / html



未指定输入文件。 p>

我使用Cpanel,该文件托管在domain.com/cron/script.php
Anyideas,感谢:p

解决方案

尝试:

  wget -O  -  http: /domain.com/cron/script.php 

并查看是否获得更好的结果。 p>

编辑:添加 - O - 不将输出写入主文件夹。


I have found many questions and articles about this but i still have some difficulties. I'm using the following command /usr/bin/php home/domain.com/public_html/cron/script.php I receive the following error Status: 404 Not Found X-Powered-By: PHP/5.2.8 Content-type: text/html

No input file specified.

i'm using Cpanel, the file is hosted on domain.com/cron/script.php Anyideas, thanks :p

解决方案

Try:

wget -O - http://domain.com/cron/script.php

and see if you get a better result.

Edit: added "- O - " to not write output to home folder.

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

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