So, a given php script works fine when I run it via a browser, in other words I type: http://server/path/to/script.php and it works.

What I want to do, though, is run it from the command line, as in: php /path/script.php.

This doesn't work, but I need it to work, so as to run it with cron.

Am I missing something here?

Thanks!

    * * * * * /path/to/php /path/to/script.php >/path/to/output.log 2>/path/to/errors.err

      Basic point you are probably missing is that you script path, when you run it as a webpage, is relative to document root. Cron jobs are looking for a server path, so you need to specify the output , at a minimum, as a server path. That is what the other posts are doing for you, or pointing out to you.

        Write a Reply...