Crons run PHP5?

Crons run PHP5?

Posted by: dakor
Posted on: 2009-09-11 12:30:00

Does Crons use PHP4 by any chance? I have a domain that is running php5 and I am trying to set up a cron on it. However, I keep getting weird parsing errors each time the cron is run.

Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/dakor/sms.dakor.ie/src/lib/Exceptions.php on line 12

this is line 12:
private $exceptionInfo;

Re: Crons run PHP5?

Posted by: andrewf
Posted on: 2009-09-11 12:31:00

If you don't specifically use PHP5 for cron jobs, it'll run with the PHP4 interpreter. Instead of "php", specify:

/usr/local/php5/bin/php

Re: Crons run PHP5?

Posted by: dakor
Posted on: 2009-09-11 13:45:00

Thanks Andrewf, that took care of it.

Edited by dakor on 09/11/09 01:46 PM (server time).

Tags: php5cronerror syntax errorexceptionslib