2015-02-11 75 views
-1

我有專用的服務器有centos 6.6和centos webpanel。現在我試圖從centos web面板中設置cron作業。我曾嘗試過這麼多命令來每分鐘運行一個php文件,但仍然沒有讓我的文件每分鐘運行一次。進一步配置:內核版本:2.6.32-26-pve,平臺:i686,發行版名稱:CentOS版本6.6(最終版本),MySQL版本:5.1.73,PHP版本:5.4.27,Apache版本:Apache/2.2.27 。 下面是我嘗試過的所有命令的列表。請幫助我與cron工作。謝謝。Cron工作不在centos工作6.6

* * * * * 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)。

+0

雖然這個問題確實有事可做通過編程,它可能更適合[服務器故障](http://serverfault.com/about)。 – Makyen 2015-02-11 04:39:39

+0

請告訴我我需要做什麼? – RadhaComEng 2015-02-11 04:41:11

+0

我認爲命令存在一些問題,而不是服務器 – RadhaComEng 2015-02-11 04:44:24

回答

0

試試:

exampledomain = 「exampledomain.com」

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