Cron job在centos 6.6中不起作用


Cron job is not working in centos 6.6

我有一台带有centos 6.6和centos webpanel的专用服务器。现在我正试图从centos网络面板设置cron作业。我尝试了很多命令,每分钟运行一个php文件,但cron作业并没有让我的文件每分钟运行。进一步配置:内核版本:2.6.32-26-pve,平台:i686,Distro名称:CentOS 6.6版(最终版),MySQL版本:5.1.73,PHP版本:5.4.27,Apache版本:Apache/2.2.27。下面是我尝试过的所有命令的列表。请帮我做cron工作。谢谢

* * * * * public_html/run.php
* * * * * /public_html/run.php
* * * * * /bin/php -q /home/user_name/public_html/run.php
* * * * * run.php
* * * * * /run.php
* * * * * /public_html/run.php
* * * * * user_name/public_html/run.php
* * * * * ~user_name/public_html/run.php
* * * * * user_name /public_html/run.php
* * * * * user_name public_html/run.php
* * * * * user_name /run.php
* * * * * user_name run.php
* * * * * user_name /home/user_name/public_html/run.php
* * * * * user_name home/user_name/public_html/run.php
* * * * * /bin/php -q /home/user_name/public_html/run.php
* * * * * user_name /bin/php -q /home/user_name/public_html/run.php
* * * * * /usr/local/php -q /home/user_name/public_html/run.php
* * * * * user_name /usr/local/php -q /home/user_name/public_html/run.php
* * * * * /home/user_name/public_html/run.php
* * * * * home/user_name/public_html/run.php
* * * * * /usr/local/php -q home/user_name/public_html/run.php

我可以从浏览器运行这个文件,它也给出了预期的结果,但cron作业无法运行这个文件。此外,我可以通过两种方式访问此文件,首先使用像www.example.com/run.php这样的域名,然后使用像http://my_ip_address/~user/run.php这样的另一种方法。

试试看:

exampledomain="exampledomain.com"

php-q/home/exampledomain/public_html/filepath/filepath/result.php