Installing GBK encoding program in Apache environment in CentOS

Source: Internet
Author: User
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

...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.