I have a PHP website running on Apache and PHP 7.1.
The application is running well on my PC, when I deploy to the server I get the following error:
PHP Parse error: syntax error, unexpected 'function' (T_FUNCTION), expecting identifier (T_STRING) or \\ (T_NS_SEPARATOR)
When I looked into the location the error is happening at, it was a PHP5.6+ syntax as I understood:
use function ...;
When I run php --version
or which php
it shows it is PHP 7.1.
Is there a setting that configures php to allow syntax above certain version?
EDIT:
phpinfo() is reporting PHP 5.5.9
I guess what I need is help on how to set Apache to use the default PHP version which is 7.1 in case of my server.
2
Answers
The answer is to disable the module PHP 5 and enable 7.1 for apache:
}