Cron Jobs run with PHP4?

software development

#1

Are cron jobs running on PHP4? I’m having trouble running my scripts:

Parse error: syntax error, unexpected T_STRING, expecting ‘{’ in /home/pies/sputnik.pl/lifelog/php/libs/xml.php on line 3

which is:

class XML extends SimpleXMLElement implements ArrayAccess {

Any way to run cron jobs with PHP5?


#2

Set the environment before calling php.

export PATH=/usr/local/php5/bin:$PATH

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost


#3

most servers have php 4 in the path. i run my cron jobs in php 5 by specifying the path to php 5, which is /usr/local/php5/bin/php. so an example job that runs at 3:30 am every day looks like this:

30 3 * * * /usr/local/php5/bin/php -f /home/username/cron/job.php

i’m not sure how you would set the path for a cron job as sXi mentions, but that might work too.

track7 - my dream-hosted site


#4

Thank you so much.

Generally I would expect my cron jobs to run with the same version of PHP as Apache uses.

There are still people who genuinely want to use PHP4?


#5

Your website runs as cgi, shell as cli.

Web default is v5, shell is v4.

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost