• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 353
  • Last Modified:

PHP cron logistics

I'm trying to run as a daily cron job a PHP script.
I've tested it in a web browser, and it works fine (and am not worried about http accesses)
I've changed the protection, so executable is okay.

The first few lines of the file are:
//  daily batch job 

Open in new window

And the error message is (note that got as far as executing the file):
cron.php: line 1: ?PHP: No such file or directory
line 2: //: is a directory

Open in new window

what did i set up incorrectly
  • 2
1 Solution
How did you entered the crobjob?
Something like this?

0 0 * * *  php /path/to/local/php/file.php
willsherwoodAuthor Commented:
YAY that was it.   adding PHP prior to the  path/script
willsherwoodAuthor Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now