Forum
Cron PHP Error
Hi,
I'm getting the below error in the PHP error logs from the cron job I've setup. My network host are suggesting its a PHP 5.5 code issue, but I thought Perch was ok with 5.5?
Here's the error and the cron line:
PHP Parse error: syntax error, unexpected '[', expecting ')' in /****/html/perch/core/lib/PerchFieldTypes.class.php on line 1465
5 * * * *
php
/****/html/perch/core/scheduled/run.php
secretcode
It may be that PHP on the commandline is using an old PHP version. Type
php -v
when logged in on the command line to see which version is being used.
Hi,
I didn't have access to the commandline but I managed to get someone that did to run it and we got the following result:
Was that running as the same user cron runs as? It really does look from the error that the command line version of PHP doesn't support the short array syntax which was introduced in PHP 5.4.
Hi,
They've come back confirming its all ok.
Is it possible I've got an old file? I've got the latest code in 'Core', should I just try the file again?
That should be absolutely fine then. Can I see your diagnostics report?
No problem:
Is everything else working as expected on this server?
This is the same one that was producing an Internal Server Error until they switched off the Opache thing.
Ok. My best suggestion is to try with this week's release.
An update, turns out the Cron was still running on 5.3, I asked our hosts twice and everytime they said everything was 5.5. I'm getting a different error now but we think thats down to it erroring on the domain without the www being present in the URL.