Forum

Thread tagged as: Problem, Error, Runway

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
Chris Comben

Chris Comben 0 points

  • 5 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

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:

php -v

PHP 5.5.12 (cli) (built: Mar 12 2015 13:24:47)

Copyright (c) 1997-2014 The PHP Group

Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies

    with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v5.0.11, Copyright (c) 2002-2015, by ionCube Ltd.

    with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies
Drew McLellan

Drew McLellan 2638 points
Perch Support

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.

cron: php55
cli: php55
web: php55

[us@place home]$ php -v
PHP 5.5.12 (cli) (built: Mar 12 2015 13:24:47)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v5.0.11, Copyright (c) 2002-2015, by ionCube Ltd.
    with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies

Is it possible I've got an old file? I've got the latest code in 'Core', should I just try the file again?

Drew McLellan

Drew McLellan 2638 points
Perch Support

That should be absolutely fine then. Can I see your diagnostics report?

No problem:

EALTH CHECK

Perch Runway is up to date
PHP 5.5.12 is up to date
MySQL 5.5.35-33.0 is up to date
Image processing available
SUMMARY INFORMATION

Perch Runway: 2.8.26, PHP: 5.5.12, MySQL: 5.1.70, with PDO
Server OS: Linux, fpm-fcgi
Installed apps: content (2.8.26), assets (2.8.26), categories (2.8.26), perch_mailchimp (2.0.1)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_mailchimp', );
PERCH_LOGINPATH: /perch
PERCH_PATH: /chroot/home/swagukor/burrellsjewellers.co.uk/html/perch
PERCH_CORE: /chroot/home/swagukor/burrellsjewellers.co.uk/html/perch/core
PERCH_RESFILEPATH: /chroot/home/swagukor/burrellsjewellers.co.uk/html/perch/resources
Image manipulation: GD Imagick
PHP limits: Max upload 64M, Max POST 64M, Memory: 2048M, Total max file upload: 64M
F1: 2edba60ed1f613d6dd804feb202456a2
Resource folder writeable: Yes
HTTP_HOST: www.burrellsjewellers.co.uk
DOCUMENT_ROOT: /home/swagukor/burrellsjewellers.co.uk/html
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
Drew McLellan

Drew McLellan 2638 points
Perch Support

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.

opcache.enable = off
Drew McLellan

Drew McLellan 2638 points
Perch Support

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.