【发布时间】:2017-03-02 04:47:12
【问题描述】:
我正在将站点移动到新服务器,但我在新服务器中的非英语字符排序错误。在旧服务器中,我得到 "é" 在新服务器中显示 " �"
一些提示:
a) 两个站点都从同一个 MySQL 服务器读取,因此问题不在于任何 MySQL 服务器配置。静态 HTML 还会显示错误的字符,而不仅仅是来自数据库的字符串。
b) 两个站点的源代码完全相同。所以,没有什么比放一个<meta charset="UTF-8">
c) 老服务器用户 PHP 5.5.9 新的 PHP 5.6.30,Ubuntu/Nginx 都有
d) 我检查了两个 php.ini 文件,没有发现任何差异!
e) 当执行 shell 命令时curl -I *URL* I GET:
旧服务器:
HTTP/1.1 200 OK
Server: nginx
Date: Wed, 01 Mar 2017 20:00:43 GMT
Content-Type: text/html
Connection: keep-alive
Keep-Alive: timeout=60
X-Powered-By: PHP/5.5.9-1ubuntu4.20
新服务器:
HTTP/1.1 200 OK
Server: nginx/1.10.1 (Ubuntu)
Date: Wed, 01 Mar 2017 20:01:21 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
我在curl -i 的答案中将这个Content-Type: text/html; charset=UTF-8 播种到新服务器,但我不知道它来自哪里。
任何想法在哪里找到问题?
旧服务器:http://www.pimentaingressos.com/ 新一:http://pimenta.curtipiu.net/
【问题讨论】: