Support » Plugin: Jetpack by WordPress.com » Fatal error: “Arrays are not allowed in class constants” … Jetpack

  • Resolved cpurrin1

    (@cpurrin1)


    I’ve been getting this all day:

    Fatal error: Arrays are not allowed in class constants in /home/content/33/8291733/html/wp-content/plugins/jetpack/vendor/automattic/jetpack-sync/src/Modules.php on line 31

    Thanks for any suggestions on how I might fix.

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 33 total)
  • cpurrin1

    (@cpurrin1)

    Line 31 seems to have sad face emoji:

    );

    Plugin Author Derek Smart

    (@dsmart)

    > Line 31 seems to have sad face emoji

    ha!

    This recent version of Jetpack 7.5 introduced some PHP 5.6 syntax, which seems to be causing the error for your site. I would recommend asking your host to upgrade the PHP version your site is running on, as it is now the minimum requirement for WordPress core as well.

    If you’re unable to do this for any reason, I suggest that you delete and re-install the prior version of Jetpack (7.4.1).

    jrivett

    (@jrivett)

    Minimum PHP version for Jetpack still shows as PHP 5.3.

    Plugin Contributor James Huff

    (@macmanx)

    Volunteer Moderator

    We’ll get that fixed now.

    Paul Ryer

    (@paul-ryer)

    I am getting the same error. I can’t log into my site, so I’m not sure how to fix this.

    Any assistance would be greatly appreciated.

    bartdu

    (@bartdu)

    Same here. Any help would be greatly appreciated!

    Plugin Contributor James Huff

    (@macmanx)

    Volunteer Moderator

    Make sure that your server is set to PHP 5.6 or higher, you’ll need to consult your hosting provider’s documentations for specifics.

    alisonhughes

    (@alisonhughes)

    I am getting the same error, and I have the updated PHP version.

    Plugin Contributor James Huff

    (@macmanx)

    Volunteer Moderator

    Which version of PHP are you running?

    Plugin Author Derek Smart

    (@dsmart)

    We’ve just pushed a new version 7.5.1 that addresses the inaccurate PHP version in readme, as well as another minor fix for a bug that was happening on (Jetpack) plugin deletion.

    If anyone is running PHP 5.6+ and are still seeing these errors, please let us know at https://jetpack.com/support

    cpurrin1

    (@cpurrin1)

    Thanks to everyone who had suggestions. It turned out that age of the server prevented more recent versions of PHP, or at least that’s what they said. Had to move to a different plan on a different server. After 12 hrs of migration hell, site and its SSL certificate seem to have migrated. Everything is fine now.

    David

    (@dmillerweb)

    Same problem with MANY of my clients’ websites. I have tried all versions of PHP from 5.4 up through 7, no luck. The only thing that works is to FTP into each site and delete the Jetpack folder from the plugins directory.

    THIS IS UNACCEPTABLE. We expect better from Automattic. If your plugin is going to fail to work, then it should fail gracefully, and give us an error message directing us how to fix it – NOT CRASH THE WHOLE SITE with obscure error messages.

    YOU NEED TO FIX THIS PLUGIN.

    Plugin Contributor James Huff

    (@macmanx)

    Volunteer Moderator

    @dmillerweb are you absolutely sure that you encountered exactly the same error listed in this thread?

    Because this particular error is caused by some PHP 5.6 code running under lower PHP versions. In other words if your server is _properly_ configured to PHP 5.6 or higher, it won’t be a problem.

    To be clear on the requirement, WordPress 5.2 (released in May) began requiring PHP 5.6.20 or higher: https://wordpress.org/news/2019/05/jaco/

    In fact, even PHP 5.6.20 is out of date these days: https://www.php.net/supported-versions.php

    While WordPress requires PHP 5.6.20 or higher, they recommend PHP 7.3 or higher: https://wordpress.org/about/requirements/

    ericksonstudio

    (@ericksonstudio)

    After updating to 7.5.1 our WordPress UI won’t fully load (loads the left column nav, but anything content-related won’t load on the right side). We’re on PHP 7.3.

    An error of type E_ERROR was caused in line 318 of the file /home/public_html/(domain removed for this post)/wp-content/plugins/jetpack/class.jetpack-idc.php. Error message: Uncaught Error: Class ‘Automattic\Jetpack\Logo’ not found in /home/public_html/(domain removed for this post)/wp-content/plugins/jetpack/class.jetpack-idc.php:318 Stack trace: #0 /home/public_html/(domain removed for this post)/wp-content/plugins/jetpack/class.jetpack-idc.php(238): Jetpack_IDC->render_notice_header() #1 /home/public_html/(domain removed for this post)/wp-includes/class-wp-hook.php(286): Jetpack_IDC->display_idc_notice(”) #2 /home/public_html/(domain removed for this post)/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array) #3 /home/public_html/(domain removed for this post)/wp-includes/plugin.php(465): WP_Hook->do_action(Array) #4 /home/public_html/(domain removed for this post)/wp-admin/admin-header.php(281): do_action(‘admin_notices’) #5 /home/public_html/(domain removed for this post)/wp-admin/plugins.php(479): require_once(‘/home/…’) #6 {main} thrown

    UPDATE: I renamed my plugins folder, then named it back to deactivate the plugins, then activated them one-by-one, activating Jetpack last. Everything worked fine until I activated Jetpack, then the same error happened again. FWIW, it does not happen on my local dev server with identical plugin setup, versions, etc. (except using PHP v. 7.3.6).

    • This reply was modified 9 months ago by ericksonstudio. Reason: Added PHP version information
    • This reply was modified 9 months ago by ericksonstudio. Reason: Added more troubleshooting information
    babchem001

    (@babchem001)

    I’m also getting the same error. Please help solve this
    Fatal error: Arrays are not allowed in class constants in /home4/babchem/public_html/wp-content/plugins/jetpack/vendor/automattic/jetpack-sync/src/Modules.php on line 31
    Website is http://www.babchem.com

Viewing 15 replies - 1 through 15 (of 33 total)
  • The topic ‘Fatal error: “Arrays are not allowed in class constants” … Jetpack’ is closed to new replies.