Home > Article > Backend Development > What to do if php5.6 gbk is garbled
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.
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!