PHP cron logistics

Posted on 2011-04-19
Last Modified: 2012-05-11
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
Question by:willsherwood
    LVL 8

    Accepted Solution

    How did you entered the crobjob?
    Something like this?

    0 0 * * *  php /path/to/local/php/file.php

    Author Comment

    YAY that was it.   adding PHP prior to the  path/script

    Author Closing Comment


    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
    Part of the Global Positioning System A geocode ( is the major subset of a GPS coordinate (, the other parts being the altitude and t…
    Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now