Jump to content



Latest News: (loading..)

- - - - -

Cron Job does not Run but does Manually

cron version php version try

  • Please log in to reply
No replies to this topic

#1 ONLINE   geoffreywalton

geoffreywalton

    Contact me for Support

  • Community Sponsor
  • 8,024 posts
  • Real Name:Geoffrey Walton
  • Gender:Male
  • Location:Norfolk, UK (close to the centre of the universe)

Posted Today, 12:27 PM

Here is a tip that may help you keep your hair for a few more years.

You set up a cron job and it gives an error such as

Parse error</b>:  syntax error, unexpected '{' in

Then if you run the same script from the command line it runs perfectly.

Naturally enough you are a little confused!!

Try running a script containing just this code

<?php
echo 'My PHP Version: ' . phpversion();
?>

and then run it manually and using cron.

In my case with a 1and1 server, cron was runnng version 4.4.9 and the site 5.4.14.

The reason for the error, in my case, was that the php command try is not available in the version of php being used by cron.

HTH

G
Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

Virus Threat Scanner
My Contributions
Basic install answers.
Click here for Contributions / Add Ons.
UK your site.
Site Move.
Basic design info.

For links mentioned in old answers that are no longer here follow this link Useful Threads.

If this post was useful, click the Like This button over there ======>>>>>.