“显示为?只在Wordpress网站活动服务器 [英] ' showing up as ? on Wordpress site live server only

查看:85
本文介绍了“显示为?只在Wordpress网站活动服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个wordpress网站,我设置在我的本地主机。我刚刚上传到我的托管和导入数据库,但所有的'显示为 。我认为这可能只是我的帖子,您可以从此示例



我认为这可能与数据库的设置有关,但我已经检查,他们有所有完全相同的设置。我试图设置一个新的数据库和导入数据,它,它没有帮助。



有没有任何想法可能会导致这与本地主机服务器完全相同?他们都在所有表格上设置了utf8mb4_unicode_ci。



解决方案:



发布此为答复,因为此问题已关闭作为重复。但是,对于任何人谁有这个问题,下面固定它为我。它与数据库无关。 wp-config.php 需要更新。我更改了 define('DB_CHARSET','utf8mb4'); 到 define('DB_CHARSET','utf8');

解决方案

这些问题通常来自数据库排序规则类型。将其更改为支持UTF-8的模式。



在mysql中,通常使用 SET NAMES utf8 PDO中的选项。



由于没有显示此页面打印方式的代码,因此无法添加到解决方案中。


I have a wordpress site which I have set up on my localhost. I've just uploaded it to my hosting and imported the database but all the ' are displaying as � . I thought it might just be my posts as you can see from this example here.

However if you look at the below image you can see that its even happening in the wordpress admin panel.

I thought it might be related to the way the database is set up but I have checked and they have all the exact same settings. I tried setting up a new database and importing the data to that and it didnt help.

Does anyone have any ideas would could be causing this as its the exact same as the localhost server? They both have utf8mb4_unicode_ci set up on all tables.

SOLUTION:

Cannot post this as an answer since this question was closed as a duplicate. However, for anyone else who has this problem the below fixed it for me. It wasn't related to the database. The wp-config.php needed updating. I changed define('DB_CHARSET', 'utf8mb4'); to define('DB_CHARSET', 'utf8');

解决方案

These issues usually come from the database collation type. Change it to one that supports UTF-8. And make sure you select as UTF-8.

In mysql this is usually done with SET NAMES utf8 or provide the options in PDO.

Since there is no code showing how this page is printed I cannot add in a solution.

这篇关于“显示为?只在Wordpress网站活动服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆