Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #2
Plazik CreditAttribution: Plazik as a volunteer commentedWhich version of PHP are you using?
Comment #3
mfby2k CreditAttribution: mfby2k commentedI am using PHP 5.6
Comment #4
Plazik CreditAttribution: Plazik as a volunteer commentedYou're upgrading from old version. Try to uninstall old version first and install new version.
Comment #5
mfby2k CreditAttribution: mfby2k commentedI disabled it uninstalled it and reinstalled it using drush it still gives me this error.
Comment #6
Pongpyng CreditAttribution: Pongpyng commentedI'm having the same problem but I'm using PHP 5.2.17 is it the problem?
Comment #7
Plazik CreditAttribution: Plazik as a volunteer commented@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.