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

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

问题描述

我发现了很多关于此的问题和文章,但我仍然遇到一些困难.我正在使用以下命令/usr/bin/php home/domain.com/public_html/cron/script.php我收到以下错误状态:404 未找到X-Powered-By:PHP/5.2.8内容类型:text/html

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

未指定输入文件.

我正在使用 Cpanel,该文件托管在 domain.com/cron/script.php任何想法,谢谢:p

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

推荐答案

尝试:

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

看看你是否得到更好的结果.

and see if you get a better result.

添加了- O - "以不将输出写入主文件夹.

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

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

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