Check the path to your php cgi executable - which php - you'll probably find that
it's #!/usr/local/bin/php
This is what the "no such file or directory" is referring to.
Chris
Don Read wrote:
> On 08-Jul-01 James, Yz wrote:
> > Hi Ben,
> >
> > When running it as a normal PHP file, I get the cron daemon emailing me
> > stuff like:
> >
> > automation/mail.php: ?: No such file or directory
> > automation/mail.php: =: command not found
> > automation/mail.php: =: command not found
> > automation/mail.php: line 7: syntax error near unexpected token
> > `mail("emailaddress@takenout",'
> > automation/mail.php: line 7: `mail("emailaddress@takenout", "mail test",
> > "$mailcontent", "$sender");'
> >
> >
>
> try a wrapper
>
> > When running it with the Perl style line at the top (as you suggested) I
> > get, "no such file or directory."
> >
> > The script is Chmodded to 755 in both cases. And I saved it as a .php and
> > .cgi file (with the root to bin/php in it). God knows what I'm doing wrong
> > ;)
> >
> > James.
> >
> >> How are you executing the script? Does it come by and run 'php
> >> yourscript.php' or does the script have a shebang ('#!/usr/bin/php') in
> >> it? I've found that works well... just put that as the first line, and
> >> it behaves as a shell script (after you make it executable, of course)
> >>
> >> Ben
> >>
> >> -----Original Message-----
> >> From: James, Yz [mailto:[EMAIL PROTECTED]]
> >> Sent: Sunday, July 08, 2001 3:39 PM
> >> To: [EMAIL PROTECTED]
> >> Subject: [PHP] Running PHP as a cron job....
> >>
> >> Hi all,
> >>
> >> This is probably going to sound incoherant, but....
> >>
> >> Do I have to do anything (other than change the permissions of a php
> >> file)
> >> to get it to run as part of a cron job? I created an extremely simple
> >> file
> >> that should just send a blank email to me (using mail()). I got an
> >> email
> >> from the cron daemon saying, "bad token", or something like that, yet
> >> when
> >> executed through a browser, the script behaves as it should.
> >>
> >> Do I have to write the php scripts differently to how I would if they
> >> were
> >> to be displayed in a browser?
> >>
> >> Neeed...Sleeeep.... ;)
> >>
> >> Cheers,
> >> James.
> >>
> >>
> >>
> >> --
> >> PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >>
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
> --
> Don Read [EMAIL PROTECTED]
> -- It's always darkest before the dawn. So if you are going to
> steal the neighbor's newspaper, that's the time to do it.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
Chris Fry
Quillsoft Pty Ltd
Specialists in Secure Internet Services and E-Commerce Solutions
10 Gray Street
Kogarah
NSW 2217
Australia
Phone: +61 2 9553 1691
Fax: +61 2 9553 1692
Mobile: 0419 414 323
eMail: [EMAIL PROTECTED]
http://www.quillsoft.com.au
You can download our Public CA Certificate from:-
https://ca.secureanywhere.com/htdocs/cacert.crt
**********************************************************************
This information contains confidential information intended only for
the use of the authorised recipient. If you are not an authorised
recipient of this e-mail, please contact Quillsoft Pty Ltd by return
e-mail.
In this case, you should not read, print, re-transmit, store or act
in reliance on this e-mail or any attachments, and should destroy all
copies of them.
This e-mail and any attachments may also contain copyright material
belonging to Quillsoft Pty Ltd.
The views expressed in this e-mail or attachments are the views of
the author and not the views of Quillsoft Pty Ltd.
You should only deal with the material contained in this e-mail if
you are authorised to do so.
This notice should not be removed.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]