Can't seem to find a fix for this issue. I'm running Magento 2.1.2 with PHP 7.0.16, however there are different versions of PHP installed on different websites on the same VPS.
When trying to execute magento/bin commands, it seems to throw the same error with any - however the most recent I've tried is:
php bin/magento setup:static-content:deploy
It throws the following errors:
PHP Warning: Cannot open '/usr/lib64/php/modules/php_browscap.ini' for reading in Unknown on line 0
PHP Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in ***/httpdocs/vendor/magento/framework/App/Bootstrap.php on line 411
The function which includes line 411 is as follows, with the problem line surrounded by **:
public function isDeveloperMode()
{
$mode = 'default';
if (isset($this->server[State::PARAM_MODE])) {
$mode = $this->server[State::PARAM_MODE];
} else {
** $deploymentConfig = $this->getObjectManager()->get(DeploymentConfig::class); **
$configMode = $deploymentConfig->get(State::PARAM_MODE);
if ($configMode) {
$mode = $configMode;
}
}
return $mode == State::MODE_DEVELOPER;
}
The only details I can find online relate to there being an incompatible installation of PHP, but that shouldn't be an issue as I'm running 7.0.16?
Bootstrap.php
on line 411? In the latest version on github there is this github.com/magento/magento2/blob/develop/lib/internal/Magento/… which does not make much sense.