LAMP配置攻略:解决Firefox浏览器显示中文乱码等问题
LAMP配置攻略:解决Firefox浏览器显示中文乱码等问题
图-LAMP
在我们配置LAMP时,经常会发现中文乱码,还是用的Firefox浏览器,悲剧啊,看看有没办法解决它!
上面在FireFox浏览器中打开mysql_test.php或phpmyadmin测试时,如果出现了中文乱码,则是默认语言设置问题,解决方法如下:
打开apache配置文件: udo gedit /etc/apache2/apache2.conf,在最后面加上:AddDefaultCharset UTF-8,如果还是乱码的,再将UTF-8改用gb2312。
重启Apache:sudo /etc/init.d/apache2 restart 再刷新mysql_test.php 中文乱码没有了。
如果要人工启动mysql:mysql -u root -p,根据提示输入密码。
如果重启Apache时出现:
* Restarting web server apache2
apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName
apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName
则还是修改apache配置文件:sudo gedit /etc/apache2/apache2.conf,在文件最后设置:ServerName 127.0.0.1
通过文章的介绍和我仔细的分析,大家找出中文乱码的解决方法了吧!快跟朋友分享吧!
评论暂时关闭