/学习笔记 · 2023年 5月 12日 0

迅睿CMS页面报错:Fatal error strict_types declaration must be the very first statement in the script in

迅睿CMS版本:4.5.6
迅睿CMS页面报错:系统故障
您的系统遇到了故障,请联系管理员处理
首先在index.php文件中打开开发者模式
开启方法:网站根目录文件./index.php
<?php
declare(strict_types=1);
header(‘Content-Type: text/html; charset=utf-8’);
// 是否是开发者模式(1开启、0关闭)
define(‘IS_DEV’, 1);
开启后刷新页面报错:
Fatal error strict_types declaration must be the very first statement in the script in C:\phpstudy_pro\WWW\1\index.php on line 8
然后检查PHP版本是否过低,查看要求版本php7.3及以上,调整高版本后仍不行,尝试注释或删除第八行代码。
declare(strict_types=1);
注释后测试可正常打开。