Syntax error, unexpected for App.php file


#1

Hi @all,
I installed my php app on the cloud server but the rest api not works.

I always receive this error:

Parse error: syntax error, unexpected ‘{’ in /var/www/html/myapp/vendor/slim/slim/Slim/App.php on line 352

The PHP version installed is 5.4.16. Is it a problem?

Thanks
Luca


#2

Yes, the current version of Slim requires PHP >= 5.5.0.

The last release of PHP 5.4 was nearly three years ago, PHP 5.5 is no longer supported at all. PHP 5.6 and PHP 7.0 are only getting security fixes. So any new projects should be on PHP 7.1 or even better PHP 7.2.

https://secure.php.net/supported-versions.php