wordpress begin主题报错处理方法

建站评论阅读模式

wordpress begin主题报错处理方法

一些使用wordpress begin主题的网友发现,从虚拟主机换成了vps,一通wordpress搬家操作。域名解析更换且成功后,浏览网站,出现这么一大串:

constant gallerytag – assumed ‘gallerytag’ (this will throw an Error in a future version ofPHP) 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) inconstant filtersb – assumed ‘filtersb’ (this will throw an Error in a future version of PHP) in……

……

以上这些错误大概意思是“使用了未定义的常量gallerytag、videotag、taotag、filtersa、filtersb,这将在未来的PHP版本中引发错误“;

怎么会这样,细一思考,这其实不怪wordpress,而是用的是“知更鸟”主题,这个主题有很多字段模型,如上面的gallerytag、videotag等,这都是主题附带的。

那解决方法有两种:

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

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

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

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

wordpress begin主题报错处理方法

就这么简单。

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

1、打开 php.ini

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

3、设置 display_errors = Off

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

继续阅读
weinxin
我的微信
运营不易,
感谢支持!
公式库网
  • 本文由 发表于 2020年11月2日 23:17:00
  • 转载请务必保留本文链接:https://www.gongshiku.com/html/202011/wordpress-beginzhutibaocuochulifangfa.html

发表评论