首页 未分类 正文内容

宝塔面板wordpress 出现Warning: Use of undefined constant taotag – assumed ‘taotag’ (this will throw an Err

admin 未分类 2021-07-07 18:24:22 104

宝塔面板wordpress“知更鸟”主题升级到php7.2,出现Warning: Use of undefined constant taotag – assumed ‘taotag’ (this will throw an Error in a future version of PHP) 解决办法

wordpress搬家操作。域名解析更换且成功后,浏览网站,出现这么一大串:

constant gallerytag – assumed ‘gallerytag’ (this will throw an Error in a future version of PHP) in……

constant videotag – assumed ‘videotag’ (this will throw an Error in a future version of PHP) in……

constant taotag – assumed ‘taotag’ (this will throw an Error in a future version of PHP) in……

constant filtersa – assumed ‘filtersa’ (this will throw an Error in a future version of PHP) in constant filtersb – assumed ‘filtersb’ (this will throw an Error in a future version of PHP) in…………好多好多


解决方法有两种:

一、升级主题,这个不太现实。


二、只是报了”Warning警告“,我能不能不让这些错误信息显示?

看来只需要关闭”PHP错误提示“就行了。宝塔面板中操作如下:

进入php管理,点“配置修改”,设置display_errors为关闭,然后保存,重启一下服务。

宝塔面板php错误提示

就这么简单。


如果不是在宝塔面板,那就要深入腹地,修改php.ini文件。

1、打开 php.ini

2、设置 error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT

3、设置 display_errors = Off

其实两个方法,只是方式不同,改的都是同一个东西。


文章目录
    搜索