Plugin could not be activated because it triggered a fatal error

I have tried to activate the plugins, but it triggered fatal errors. I have tried different plugins, same issue happened.

for example:

  1. Typekit
    Parse error: syntax error, unexpected ‘[’ in /home4/lemonlea/public_html/wp-content/plugins/tco-typekit/tco-typekit.php on line 114

  2. Layerslider
    Parse error: syntax error, unexpected T_FUNCTION in /home4/lemonlea/public_html/wp-content/plugins/LayerSlider/classes/class.ls.popups.php on line 195

Please help to check and let me know the solutions. Thanks.

I just updated the php setting, and the issue was resolved. Thanks.

Hey,

Thanks sharing your workaround! :slight_smile:

FYI - This worked for me too… but I thought I would clarify what Viterdan said previously as the wording confused me for just a bit.

When he said " I just updated the php setting" he was referring to the PHP version setting. You can ask your host to do this for you or you can do it yourself via Cpanel using the PHP version manager.

I just updated to version PHP 7.1.9 and can confirm that it resolved the fatal error issue when trying to activate plugins.

Hope this was helpful

@BIGSHOTInt

Thank you for your detailed explanation. X theme will run with PHP v5.6.x however WordPress recommends PHP v7.x to avoid any plugin conflicts and to run it smoothly (https://wordpress.org/about/requirements/).

Thanks!