Jump to content

Cron Jobs at Heart Internet.


gevans

Recommended Posts

I've setup a cron job using my admin panel at heart internet.

 

Everytime it runs I get an email of the results. When I call this file directly it runs fine. When it runs via the cron I get the following errors;

 

[pre]X-Powered-By: PHP/5.2.10

Content-type: text/html

 

/home/sites/example.co.uk/public_html/blog/wp-content/plugins/gareth_twitter/cron.php: line 2: ?php: No such file or directory

/home/sites/example.co.uk/public_html/blog/wp-content/plugins/gareth_twitter/cron.php: line 3: =: command not found

/home/sites/example.co.uk/public_html/blog/wp-content/plugins/gareth_twitter/cron.php: line 4: syntax error near unexpected token `'/home/sites/example.co.uk/public_html/blog/wp-content/plugins/gareth_twitter/'.$filename'

/home/sites/example.co.uk/public_html/blog/wp-content/plugins/gareth_twitter/cron.php: line 4: `include('/home/sites/example.co.uk/public_html/blog/wp-content/plugins/gareth_twitter/'.$filename);'[/pre]

 

'example' is replaced with my domain.

 

First three lines of the file;

 

/usr/bin/php5
<?php
$filename = 'tweets.php';

 

The first error is on line to where I have the php oppening tags '<?php'. They're offering me now support on this as it's a 'coding' problem.

 

Any ideas what might be going on?

 

Cheers,

Gareth

 

EDIT:

 

The first line of the file is a line they say to add;

 

If the scheduled program includes code from a scripting language, the path for the interpreter must be specified before the script. For example, /usr/bin/perl (Perl), /usr/bin/php (PHP 4) or /usr/bin/php5 (PHP 5)

 

Link to comment
https://forums.phpfreaks.com/topic/177086-cron-jobs-at-heart-internet/
Share on other sites

Hmmmmm, they do mention a shebang on the next line of their info;

 

If the scheduled program includes code from a scripting language, the path for the interpreter must be specified before the script. For example, /usr/bin/perl (Perl), /usr/bin/php (PHP 4) or /usr/bin/php5 (PHP 5)

 

If the script being run is adapted from a CGI script, ensure the first line of the script is a 'shebang' line containing the correct interpreter path - as above - (for example #!/usr/bin/perl).

 

I'm trying this as we speak (waiting for an email)....

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.