The GBK encoding program web page is garbled in Apache environment in CentOS. Problem description in CentOS system using Apache server install GBK encoding program garbled, this is mainly because the default installation of Apache server character encoding for UTF-8, if there is no problem in the GBK program, it is described that garbled characters occur in the program that uses the Apache server to install GBK encoding in the CentOS system, mainly because the default installed Apache server character encoding is UTF-8, if the GBK program does not force encoding, garbled characters are generated.
Solution
1. open the Apache configuration file httpd. conf, for example,/etc/httpd/conf/httpd. conf by default.
# Vi/etc/httpd/conf/httpd. conf
2. find the adddefacharcharset configuration item.
Adddefacharcharset UTF-8
3. modify the adddefacharcharset configuration and disable the configuration characters as follows:
Adddefacharcharset Off
4. you can also set the default Apache encoding to GB2312 as follows:
Adddefacharcharset GB2312
...