Home > Operation and Maintenance > CentOS > How to solve the problem of Chinese garbled characters in php under centos

How to solve the problem of Chinese garbled characters in php under centos

WJ
Release: 2020-06-02 16:18:56
Original
1983 people have browsed it

How to solve the problem of Chinese garbled characters in php under centos

How to solve the problem of garbled Chinese characters in php under centos?

The php webpage outputs garbled characters under ubuntu, without involving database encoding:

Modify"/etc/php5/apache2/php.ini"Change

default_charset = "iso-8859-1"
Copy after login

to

default_charset = "utf-8"
Copy after login

and then restart apache:

sudo /etc/init.d/apache2 restart
Copy after login

Related reference: centOS tutorial

The above is the detailed content of How to solve the problem of Chinese garbled characters in php under centos. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template