ThinkPHP V5.1.18 部署到服务器上就报错,本地正常

浏览:1017 发布日期:2018/07/10 分类:求助交流
我使用的是ThinkPHP V5.1.18版本
服务器上php版本是PHP 5.6.36 (cli)

http://abc.com/public/index.php
为什么在服务器上访问时报如下错误,在本地电脑都能正常访问

[4] ErrorException in Helpers.php line 83
syntax error, unexpected '?'
/**

Return current url.
*

@return string
*/
function current_url()
{

$protocol = 'http://';

if ((!empty($_SERVER['HTTPS']) && 'off' !== $_SERVER['HTTPS']) || ($_SERVER['HTTP_X_FORWARDED_PROTO'] ?? 'http') === 'https') {
$protocol = 'https://';
}

return $protocol.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
}

/**

Return random string.
*
Call Stack
in Helpers.php line 83
at Error::appShutdown()
Environment Variables
最佳答案
评论( 相关
后面还有条评论,点击查看>>