Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem of Chinese garbled code in graphical interface caused by php in zabbix monitoring

2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how to solve the problem of Chinese garbled codes in the graphical interface caused by zabbix monitoring due to php, I believe most people do not know much about it, so share this article for your reference. I hope you will gain a lot after reading this article. Let's learn about it together.

Solve the problem of garbled codes in the graphical interface of the Zabbix monitoring system caused by adding the-enable-gd-jis-conv option to the compiled php.

Phenomenon:

Php compilation parameters:

Description:

If the-enable-gd-jis-conv option is enabled when PHP compiles, then non-ASCII characters (such as Kanji, Pinyin, Greek, and arrows) will be treated as EUC-JP encoding ("fonts that support JIS encoding" in phpinfo), resulting in garbled (because Western fonts do not have Kana or Kanji, they are generally all represented as boxes). The imagettftext () function is a function that writes characters to a picture, and this problem is caused by this function.

Checked several tutorials on the Internet is not complete, the following is my production practice, in the zabbix3.2 version, php7.2 version

Method 1:

Recompile and install php and disable the-enable-gd-jis-conv option, which is more expensive

Method 2:

Due to the long service life of php in production environment, I don't know if there is any application in use, and I dare not recompile it easily, so I solve the problem according to method 2.

Step one:

Modify the graphs.inc.php file in / etc/nginx/html/zabbix/include (backup first)

Cp graphs.inc.php graphs.inc.php.bak

Vim graphs.inc.php # adds the following code at the end

Function to_entities ($string) {$len = strlen ($string); $buf = ""; for ($I = 0; $I < $len; $iTunes +) {if (ord ($string [$I]))

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report