Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2008
    Location
    Singapore, Australia, America
    Posts
    96
    Plugin Contributions
    0

    Default PHP Parse error: syntax error, unexpected '[' in paypalwpp.php

    Hi there,

    I am running into some problem at checkout. I think I should upgrade the PHP version, which I did yesterday to V.7.1 but that caused more problems, and I wasn't able to view product in single product page:

    PHP Code:
    [16-May-2018 06:23:17 CST6CDTPHP Warning:  Illegal string offset 'products_id' in /includes/classes/navigation_history.php on line 40
    [16-May-2018 06:23:17 CST6CDTPHP Warning:  Illegal string offset 'cPath' in /includes/classes/navigation_history.php on line 40
    [16-May-2018 06:23:17 CST6CDTPHP Warning:  A non-numeric value encountered in /includes/classes/categories_ul_generator.php on line 58
    [16-May-2018 06:23:17 CST6CDTPHP Warning:  A non-numeric value encountered in /includes/classes/categories_ul_generator.php on line 73
    [16-May-2018 06:23:17 CST6CDTPHP Warning:  A non-numeric value encountered in /public_html/includes/classes/categories_ul_generator.php on line 73
    [16-May-2018 06:23:17 CST6CDTPHP Warning:  A non-numeric value encountered in /public_html/includes/classes/categories_ul_generator.php on line 73
    [16-May-2018 06:23:17 CST6CDTPHP Warning:  A non-numeric value encountered in /public_html/includes/classes/categories_ul_generator.php on line 73
    [16-May-2018 06:23:17 CST6CDTPHP Warning:  A non-numeric value encountered in /public_html/includes/classes/categories_ul_generator.php on line 73
    [16-May-2018 06:23:17 CST6CDTPHP Warning:  A non-numeric value encountered in /public_html/includes/classes/categories_ul_generator.php on line 73
    [16-May-2018 06:23:18 CST6CDTPHP Fatal error:  Uncaught ErrorCannot use string offset as an array in /includes/modules/westminster_new/additional_images.php:132
    Stack trace
    :
    #0 /includes/templates/template_default/templates/tpl_modules_additional_images.php(13): require()
    #1 /includes/modules/tabbed_products_pro.php(198): require('/home/simplear/...')
    #2 /includes/templates/westminster_new/templates/tpl_product_info_display.php(18): require('/home/simplear/...')
    #3 /includes/modules/pages/product_info/main_template_vars.php(178): require('/home/simplear/...')
    #4 /includes/templates/westminster_new/common/tpl_main_page.php(253): require('/home/simplear/...')
    #5 /index.php(97): require('/home/...')
    #6 {main}
      
    thrown in /includes/modules/westminster_new/additional_images.php on line 132 
    So, I rolled back to PHP7 instead, and while I am now able to add items to cart, but when checking out, it hits a blank page, and my log shows this error message:

    PHP Code:
    PHP Parse error:  syntax errorunexpected '['expecting ',' or ';' in /includes/modules/payment/paypalwpp.php on line 1148 
    I am preparing for my finals, so I can't do anything major such as upgrading my cart from v1.5.4p1 to most current version or upgrade the template. Is there a temporary fix that I can use for now?

    Thanks in advance!


    Site: http://simpleartsplanet.com
    ZC v1.5.4p1
    PHP 7.0
    Template: westminster_new

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,498
    Plugin Contributions
    88

    Default Re: PHP Parse error: syntax error, unexpected '[' in paypalwpp.php

    Zen Cart 1.5.4 was not designed to run on PHP versions > 5.6, as your debug-logs indicate.

    Line 1148 of paypalwpp.php, for instance, contains
    Code:
              global $$order_totals[$i]['code'];
    On PHP versions > 5.6, that "runs into" the change to indirect variables (aka variable variables), as described here:

    http://php.net/manual/en/migration70.incompatible.php

    Try changing your PHP version to a variant of 5.6! (Upgrading Zen Cart is a wise idea too)

 

 

Similar Threads

  1. PHP Parse error: syntax error, unexpected '[' in payeezyjs.php
    By spbw in forum Built-in Shipping and Payment Modules
    Replies: 22
    Last Post: 9 Sep 2017, 11:24 AM
  2. Install: Parse error: syntax error, unexpected '/' in /includes/application_top.php
    By dlucarelli in forum Installing on a Linux/Unix Server
    Replies: 8
    Last Post: 26 Aug 2010, 02:08 PM
  3. Replies: 3
    Last Post: 13 Mar 2009, 05:20 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR