"Parse error: syntax error, unexpected T_STATIC in /oursite/sites/all/modules/services/servers/rest_server/includes/ServicesRESTServerFactory.inc on line 33"
After installing the 3.x-dev version, I get the above error at any endpoint I attempt to contact. No endpoints work - all generate this error.
These are all endpoints that worked fine before I updated to the dev version.
I have tried de-installing and re-installing. I even went so far as to clean up the database by hand (removing menu and system entries, services endpoint table, etc) and do a completely clean install. Still no-go. The site is running Drupal 7.22. The only weird thing I'm seeing is that the status report complains that I have not included the spyc.php library in the rest_serrver/lib directory, even though it is clearly present and readable by the web server process.
I have a hard time believing this is happening to other people, since it completely prevents services from functioning at all, and I can't imagine I'd be the first to complain. Can anyone offer suggestions about what I may have done wrong?
Comment | File | Size | Author |
---|---|---|---|
#5 | ServicesRESTServerFactory.inc_.patch | 580 bytes | barthje |
Comments
Comment#1
Coyote commentedI just did a completely fresh install of a blank Drupal site, with only the services module and the modules it depends on. Got the same exact error. So.... does this mean the dev version is just broken?
Comment#2
Coyote commentedArgh. Most sincere apologies. The problem is that our php install is ancient. So, yeah, apparently Services won't work with php 5.2.11
Comment#3
apotek commentedThe
static::
syntax is only available in php 5.3 and up.So unfortunately that line creates a dependency on 5.3.
Comment#4
SpaJenniOs commentedThe system requirements for Drupal 7 are PHP 5.2.5 or higher (PHP 5.3 recommended).
https://drupal.org/requirements
As of PHP 5.3.0, it's possible to reference the class using a variable.
http://php.net/manual/en/language.oop5.static.php
A note on the issue page stating that you need to upgrade to PHP 5.3 before installing this update would be great.
Comment#5
barthje commentedIt seems like this is the only line that needs PHP 5.3. I wonder why this way was chosen? It only hurt people that can't upgrade to PHP 5.3+
Anyway, a small patch that helped us with this problem is included.
Comment#6
ygerasimov commentedThanks for spotting this. Committed.
Comment#8
swapnilp commentedPatched submitted at #5 worked for me.
Resolved error "Parse error: syntax error, unexpected T_STATIC" by applying provided patch to ServicesRESTServerFactory.inc
Thanks Bart!
来自 https://www.drupal.org/node/2003396