Home  >  Article  >  Backend Development  >  What to do if php5.6 gbk is garbled

What to do if php5.6 gbk is garbled

藏色散人
藏色散人Original
2021-05-25 09:22:231928browse

Solution to php5.6 gbk garbled code: First, add the parameter "default_charset=Off" under the php tag of "/etc/php.ini"; then restart the amh environment to take effect.

What to do if php5.6 gbk is garbled

The operating environment of this article: Windows7 system, PHP5.6 version, DELL G3 computer

Under the PHP5.6 version, gbk encoding is not supported , the solution to garbled characters

Under the amh 4.2.1 version developed by our company, the php5.6 version is used. In this version, gbk encoding is not supported by default. If the website is gbk encoded, it will appear Garbled characters.

Cause:

php 5.4.0 The default value for the encoding parameter was changed to UTF-8.

It can be seen that after the php5.4 version, the php encoding has been changed to UTF-8 by default

Solution:

In Add the parameter default_charset = Off under the [php] tag of /etc/php.ini, and then restart the amh environment to take effect

sed -i -e '/[PHP]/a\default_charset = Off' /etc/php.ini
/etc/init.d/amh-start

[Recommended learning: PHP video tutorial]

The above is the detailed content of What to do if php5.6 gbk is garbled. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn