Warning: Use of undefined constant taotag – assumed ‘taotag’ (this will throw an Error in a future version of PHP) 解决办法

  • Warning: Use of undefined constant taotag – assumed ‘taotag’ (this will throw an Error in a future version of PHP) 解决办法已关闭评论
  • A+
所属分类:WORDPRESS

用wordpress主题“知更鸟”的时候,当他的PHP升级到7.2以上的时候,打开网站做出如下提示:

错误提示

Warning: Use of undefined constant videotag - assumed 'videotag' (this will throw an Error in a future version of PHP) in /www/wwwroot/www.skykkk.com/wp-content/themes/fujieace/inc/post-taxonomy.php on line 271 Warning: Use of undefined constant taotag - assumed 'taotag' (this will throw an Error in a future version of PHP) in /www/wwwroot/www.skykkk.com/wp-content/themes/fujieace/inc/post-taxonomy.php on line 374

用了“知更鸟”这个主题,甚至还会出现如下类似错误:

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

 

解决方法

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

 

解决此种问题其实也不是很难,只是报了”Warning警告“,我们只需要关闭”PHP错误提示“就行了。具体步骤如下:

 

1、打开 php.ini

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

3、设置 display_errors = Off