I'm trying to run an scheduled php script using cronniX on mac os x. So far I haven't got much promising results, but i think i'm close to it.
I'm not familiar at all with Terminal and its language syntax so I've been pulling resources from all over the web to figure out what's going on.
The test php script all it does is to write a time stamp on a text file. It works well when I run it manually from localhost. both the php and txt files are set to permission # 777.
Now when I run this as a cronjob i get a series of errors mailed to me. I've tried different options for the cronjob, all of them failing.
If someone with more knowledge on this area could look into this and give me some hints I would really appreciate it. I am sure some of these errors are trivial to you.
Here are my different attempts and the errors mailed:
Expand|Select|Wrap|Line Numbers
- * * * * * /Users/mauro/Sites/phpTests/croned/croned.php
- error reported 1:
- /Users/mauro/Sites/phpTests/croned/croned.php: line 1: ?PHP: No such file or directory
- /Users/mauro/Sites/phpTests/croned/croned.php: line 2: syntax error near unexpected token `('
- /Users/mauro/Sites/phpTests/croned/croned.php: line 2: `$date = date("l dS \of Ffclose($printout);'date); xt", "a");
- error reported 2:
- /Users/mauro/Sites/phpTests/croned/croned.php: line 1: ?PHP: No such file or directory
- /Users/mauro/Sites/phpTests/croned/croned.php: line 2: syntax error near unexpected token `('
- fclose($printout);'date); xt", "a"); oned.php: line 2: `$date = date("l dS \of F Y h:i:s A");
Expand|Select|Wrap|Line Numbers
- * * * * * http://localhost/~mauro/phpTests/croned/croned.php
- error reported
- /bin/sh: line 1: http://localhost/~mauro/phpTests/croned/croned.php: No such file or directory
Expand|Select|Wrap|Line Numbers
- * * * * * /usr/bin/php http://localhost/~mauro/phpTests/croned/croned.php
- error reported
- Could not open input file: http://localhost/~mauro/phpTests/croned/croned.php
Expand|Select|Wrap|Line Numbers
- * * * * * /usr/bin/php /Users/mauro/Sites/phpTests/croned/croned.php
- doesn't even sent me an email!