【问题标题】:Cron centOS "Could not open input file" errorCron centOS“无法打开输入文件”错误
【发布时间】:2014-02-22 17:23:19
【问题描述】:

我正在尝试通过 cron 运行 php 文件,但它不起作用。当我在浏览器中输入脚本的 url 时,它可以工作。所以我认为问题出在cron。我的操作系统是centOS。

这是 crontab。

* * * * *  /usr/bin/php /var/www/htdocs/wordpress/text.php

text.php的内容是""

来自 cron 的电子邮件说,

X-Cron-Env: <LANG=en_US.UTF-8>
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=root>
X-Cron-Env: <USER=root>
Status: RO

Could not open input file: /var/www/htdocs/wordpress/text.php

这是“ls -l /var/www/htdocs”

-rw-r--r--.  1 root root     50  1 29 22:04 2014 index.html~
-rw-r--r--.  1 root root     22  1 29 22:04 2014 index.php
drwxr-xr-x. 13 root apache 4096  1 30 14:36 2014 phpmyadmin
drw-rw-rwx.  8 root root   4096  1 30 20:11 2014 wordpress

你能告诉我如何解决这个问题吗?

【问题讨论】:

    标签: php cron centos


    【解决方案1】:

    您缺少绝对路径的开头/

    * * * * *  /usr/bin/php /var/www/htdocs/wordpress/text.php
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-07-17
      • 2020-07-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多