本文介绍了使用 CPanel 在 cron 作业中运行 PHP 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!
问题描述
我只是想在 CPanel 中使用 cron 作业运行 PHP 脚本 - 这是正确的语法:
I am just trying to run a PHP script using a cron job within CPanel - is this the correct syntax:
/usr/bin/php -q /home/username/public_html/cron/cron.php >/dev/null
我没有收到任何说明 cron 已完成的电子邮件通知,我是否需要对 PHP 文件执行任何特定操作?
I am not getting any email notifications stating a cron has been completed, do I need to do anything specific with the PHP file?
推荐答案
在 crontab 系统中:
In crontab system :
/usr/bin/php是 php 二进制路径(在某些系统中不同,例如:freebsd/usr/local/bin/php, linux:/usr/bin/php)/home/username/public_html/cron/cron.php应该是你的 php 脚本路径/dev/null应该是 cron 输出,例如:/home/username/stdoutx.txt
/usr/bin/phpis php binary path (different in some systems ex: freebsd/usr/local/bin/php, linux:/usr/bin/php)/home/username/public_html/cron/cron.phpshould be your php script path/dev/nullshould be cron output , ex:/home/username/stdoutx.txt
所以你可以通过查看 cron 输出来监控你的 cron /home/username/stdoutx.txt
So you can monitor your cron by viewing cron output /home/username/stdoutx.txt
这篇关于使用 CPanel 在 cron 作业中运行 PHP 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!
The End



大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)