Cron centOS "Could not open input file" error

admin

Administrator
Staff member
I'm trying to run php file by cron, but it doesn't work. When I enter the url of my script in the browser, it works. So I think the problem is in the cron. My OS is centOS.

This is crontab.

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

The content of text.php is ""

The email from cron says,

Code:
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

And this is "ls -l /var/www/htdocs"

Code:
-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

Could you tell me how to solve this?