bepsvpt/secure-headers

syntax error, unexpected '?' in SecureHeaders.php

jeanjoe opened this issue · 2 comments

Hello, I Had installed this package and configured it well on my local machine in laravel 5.4 and it ran without any problems but when i uploaded to the server, I encountered this error .

FatalErrorException in SecureHeaders.php line 121: syntax error, unexpected '?'

It was complaining about this line of code in vendor/bepsvpt/secure-headers/src/SecureHeader.php

$csp = new CSPBuilder($this->config['csp']);

if (! ($this->config['csp']['https-transform-on-https-connections'] ?? true)) {
/* @todo wait for upstream package releasing new version */
// $csp = $csp->disableHttpsTransformOnHttpsConnections();
}
Can anyone help figure out how to fix this, please?

Hi @jeanjoe,

Please check the php version on your server, the minimum requirement version is 7.0.

Thank you very much, I was using 5.6 and i just changed to 7.0 and it worked perfectly. Thanks for the great package and great team for your support