PHP 8.4+ 的弃用告警(GD imagedestroy()、隐式 nullable 参数、非规范布尔转换等) 会被 think\Error::appError() 升级为 ErrorException 并中断请求,表现为后台 登录页验证码图片 500、页面 404。在 application/common.php、admin/common.php、 api/common.php 中设置 error_reporting(E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED & ~E_NOTICE), 仅屏蔽弃用/提示级告警,真实错误不受影响(与 yjyf 站同一修复)。
12 行
466 B
PHP
12 行
466 B
PHP
<?php
|
||
|
||
/**
|
||
* PHP 8.x 兼容垫片(ThinkPHP 5.0)
|
||
*
|
||
* PHP 8.4+ 的 E_DEPRECATED(如 GD 的 imagedestroy()、隐式 nullable 参数、
|
||
* 非规范布尔转换等)会被 think\Error::appError() 升级为 ErrorException,
|
||
* 直接中断请求(验证码图片 500、页面 404 等)。
|
||
* 仅抑制「弃用/提示」级告警,真实错误(error/exception)不受影响。
|
||
*/
|
||
error_reporting(E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED & ~E_NOTICE);
|