2

I need to change my Symfony2 website to a new server and I've noticed that the new server is currently installed php 5.4, when Symfony2 need a minimum of 5.5.9. By doing some tests they are taking place some errors like:

php.CRITICAL: Fatal Parse Error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) {"type":4,"file":"/home/admin/web/websitename.com/app/vendor/doctrine/common/lib/Doctrine/Common/Proxy/ProxyGenerator.php","line":62,"level":6143,"stack":[]} []

which is probably product of the version. I wonder if anyone has had this problem and has installed a Symfony2 in php 5.4, maybe down to an older version of the framework. I know that the easy way it would be to update the version of php but currently that's not an option.

Thanks in advance

abdiel
  • 2,078
  • 16
  • 24

2 Answers2

0

Moving a Symfony2 project to another server which have a different version of php (especially when it's a lower version) causes recurrently an error like yours.

Try to remove your vendor directory, maybe backup your composer.lock and redo a fresh installation by running composer install .

Also, manually remove all in the cache directory and verify the permissions of your server directories are the first things to do.

chalasr
  • 12,971
  • 4
  • 40
  • 82
  • 1
    Thanks for your answer but the real problem was the php version and doctrine, in a few minutes I going to publish the solution. – abdiel Feb 10 '16 at 13:46
0

Since the problem seems to be in doctrine common bundle I try with some old version of it, looking for some one compatible with php 5.4, specifically someone when the function::class is not used. Finally it work with the next combination:

"doctrine/common": "2.4.2",
"doctrine/dbal": "2.4.4",
"doctrine/orm": "2.4.7",
"doctrine/doctrine-bundle": "~1.2"

Update composer and done.

abdiel
  • 2,078
  • 16
  • 24