Support » Plugin: WooCommerce MyParcel » syntax error, even after both installation methods

  • Resolved verretpa

    (@verretpa)


    Dear reader.

    Installation was no problem, but once activating this plugin the wordpress went blank and in /var/log/php-fpm/www-error.log there was this error message:

    PHP Parse error: syntax error, unexpected ‘[‘ in /usr/share/wordpress/wp-content/plugins/woocommerce-myparcel/includes/class-wcmp-frontend.php on line 442

    I removed and reinstalled the plugin, even manually, but that didn’t help.

    System info:
    centos 6
    nginx 1.10.2-1.el6
    php-fpm 5.3.3-49.el6
    php 5.3.3-49.el6

    Thanks for thinking about this problem.

    Kind regards.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Richard Perdaan

    (@richardperdaan)

    Hi @verretpa,

    Thank you for your message.

    The reason that you see the error message is because php 5.3 use the arrays elements differently. The reason that we do not support this is because PHP 5.3 was supported until 14 August 2014.

    The MyParcel plugin works from php 5.6 or higher.
    My advice is to update your PHP version to a minimum of php 5.6.

    Ewout

    (@pomegranate)

    required version check is against 5.3 though:
    https://github.com/myparcelnl/woocommerce/blob/master/woocommerce-myparcel.php#L123-L125

    readme does not declare minimum PHP version either (see: Minimum PHP Version Requirement)

    Plugin Author Richard Perdaan

    (@richardperdaan)

    Hi @pomegranate,

    It is true that this is inside the code. We discussed it within the MyParcel team and we are not going to support this php version anymore. It does not seem safe to support lower than php 5.6 from safety aspects.

    It is also true that I have to adjust the texts and that is what I will certainly do.

    From PHP 5.4 the plugin must work properly. The tests I do, are starting at php 5.6. That is why I recommend it from PHP 5.6

    Ewout

    (@pomegranate)

    what I meant is that you can prevent such fatal errors by declaring the correct PHP version in the plugin code, the user will then see a notice (even before updating if you put it in the readme as well as the init check) rather than having their site crashed

    Thanks.

    I will try to use software collections for PHP7.

    Kind regards.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘syntax error, even after both installation methods’ is closed to new replies.