Jetpack Fatal Error: Arrays are not allowed in class constants

Some WordPress support users reported an error message after updating Jetpack:

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

This message is related to the PHP version your server is running. As we can read in Jetpack’s page at the WP official plugin repository, the required PHP version is 5.6, at least.

As WordPress 5.2 — the most recent WP major version — requires PHP 5.6.20 at least, the update is something that you’d have to do sooner or later. Additionally, it’s always good to remember that even PHP 5.6 doesn’t get security updates anymore. There are so many reasons to update that it would require another entire text but security and perform are the keys here.

The PHP update process is something strongly related to your hosting company. If you have access to some control panel, like cPanel for instance, you should see an option to change it. Pay special attention if your hosting company allows different PHP versions based on directories: you will want to apply the changes to your website root folder. And always have a backup.

If this is something you aren’t comfortable to change and you would like some professional assistance, feel free to contact me through Codeable and I’ll be happy to help! 🙂

Felipe Elia

Associate Director of Platform Engineering at 10up, WordPress Core Contributor, Global Polyglots Mentor in, and Locale Manager in the Brazilian WP Community.