I am getting this error message when updating database script.

Parse error: syntax error, unexpected T_FUNCTION in sites/all/modules/google_analytics_reports/google_analytics_reports.install on line 144

Comments

mfby2k created an issue. See original summary.

Plazik’s picture

Component: Miscellaneous » Reports module

Which version of PHP are you using?

mfby2k’s picture

I am using PHP 5.6

Plazik’s picture

You're upgrading from old version. Try to uninstall old version first and install new version.

mfby2k’s picture

I disabled it uninstalled it and reinstalled it using drush it still gives me this error.

Pongpyng’s picture

I'm having the same problem but I'm using PHP 5.2.17 is it the problem?

Plazik’s picture

@Pongpyng, yes, the problem is in PHP version. Update function contains "anonymous function" which was introduced in PHP 5.3 https://secure.php.net/manual/en/functions.anonymous.php.

But if you deleted old version and install new you won't have this error.