PHP Cron job error: "Could not open input file"

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
willothewisp
Forum Newbie
Posts: 2
Joined: Mon Jun 08, 2009 3:49 am

PHP Cron job error: "Could not open input file"

Post by willothewisp »

I'm a newbie when it comes to Cron but I need to set up a script which will run every night at midnight and do various tasks.

The problem is that whenever I run the script using Cron, I get the following e-mailed back to me:

Could not open input file: /var/www/vhosts/SITENAME/httpdocs/_auto/cleanup.php
where SITENAME is the name of my site's directory on the server. The cron line I use to execute this script is:

/usr/bin/php /var/www/vhosts/SITENAME/httpdocs/_auto/cleanup.php

I've checked the location of PHP, and of the script I'm trying to run, and they're fine. I've also checked the permissions, and they're set to 0777 so it should work.

Can anyone shed any light as to why it's not working?

Thanks,

Willo
girl devs have more fun :wink:
User avatar
Raph
Forum Commoner
Posts: 43
Joined: Wed May 27, 2009 6:33 pm

Re: PHP Cron job error: "Could not open input file"

Post by Raph »

I'm not a Linux Guru myself, and I never got your method to work. The only thing that worked for me was to use wget in silent mode and define the url via localhost. Works perfectly.
Post Reply