Re: CRONTAB
| From: | Miguel Cruz | Date: | Fri, 05 Apr 2002 22:26:38 +0000 |
| Subject: | Re: CRONTAB | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-91809@lists.php.net to get a copy of this message | ||
On Fri, 5 Apr 2002, Julian wrote:
> I am attempting execute automatically an script PHP, all the days at a
> certain hour.
>
> I configured the cron to executes it, but when it is executed, instead of
> working, I receive an email in
> my main account where say:
>
> /home/vipteam/public_html/distribuidor/mailf.php: echoNo tinterrumpir:
> command not found
If you are running from cron, you need to tell it to use the php
interpreter.
So either tell it in your crontab entry with something like:
0 * * * * /usr/local/bin/php /blah/blah/mailf.php
Or channel it through your web server with something like this:
0 * * * * /usr/bin/lynx http://127.0.0.1/distribuidor/mailf.php
Or put a comment in the first line of your PHP file that tells the shell
to use PHP to run it:
#!/usr/local/bin/php
All of these paths are samples; you'll need to figure out where these
things are on your system.
miguel