The Apache environment in CentOS supports GBK encoding to solve the problem of webpage garbled characters.

Source: Internet
Author: User
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 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 # vi/etc/httpd/conf/httpd. c by default.

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 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

Related Article

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.