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
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)....

Link to comment
Share on other sites

Sorry, by directly I meant. via a browser while the first line was taken out.... not really a sure thing test...

 

It may be working now, no errors, but I have to change some flat files to cheque that its working, so we're getting close...

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.