Syntax error, Unexpected 'class' (T_CLASS), expecting Identifier (T_STRING) - Remote Server Only

Asked

Viewed 1,786 times

1

I have a platform that I developed using Zend Framework 3.0.

This platform works locally but when I migrate it to the server, it throws multiple errors with this syntax:

Parse error: syntax error, Unexpected 'class' (T_CLASS), expecting Identifier (T_STRING) in /home/gowebsales/vendor/zendframework/zend-form/src/Formelementmanager/Formelementmanagerv3polyfill.php on line 37

My platform is running PHP in version 5.6. The server is running 5.4.

What changes I need to make to solve this problem?

  • 1

    If PHP versions are different, you already have a strong candidate to cause the problem, it is not?

  • I know that the versions of php are whoever is causing the error.. I wanted to know how and what I have to change to platform work.

  • It’s not just updating the server’s PHP?

  • Yes, but it would not be wise to change the server version, which hosts multiple websites, just for my platform to work

  • It is. You should have thought about it before then. PHP has these incompatibilities between versions even, it has nothing to do. If you knew that the application would run on a 5.4 server you should have developed using 5.4. A priori you only have two options: 1) Make your application run in the correct version of PHP (regardless of how this is done); and 2) Adapt your application to run in PHP version 5.4.

  • I spoke to the boss of the company that I am currently working on. The company will create an accommodation in version 5.6, which will solve the problem. Turn to answer so you can close the question and thanks for the help ! :)

  • 1

    The framework documentation contains: Zend Framework 3 requires PHP 5.6

Show 2 more comments

1 answer

0


This is a problem in solving class names. The cause of this you yourself said in the question: PHP versions are different in development and in the publishing server.

A priori you only have two options: 1) Make your application run on the right version of PHP - regardless of how it’s done; and 2) Adapt your application to run in PHP version 5.4.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.