Haven't written PHP for a long time today when suddenly its strange garbled error reproduced is I wonder Ah! , let's look at my troubleshooting methods and give a reference to a friend who has the same problem.
There is a long project to be inexplicably restarted today, this project is XAMPP environment-do not know xampp? You google it, I don't say much.
First Pro, APAHCE configuration, PHP configuration ... All the way down there is no problem. Start the visit, the problem is, it is strange to expect to run the page, but out of the unexpected garbled problem.
The first thought was that Apache's default character set was added to the Apache language extension configuration file:
Adddefaultcharset UTF-8
My Site page is utf-8, and restarting does not work as expected-that is, it doesn't work! The efforts of the parties did not work, so in the httpd.conf wasted half an hour. Start depressed ...
Half an hour passed, smoked a cigarette, think Phpinfo may be able to help, oh, so open phpinfo a look, immediately stunned. In the HTTP Response headers column under the Content-type item impressively appeared: Text/html gbk words, my god--, why is GBK it. Then re-look for the settings, httpd.conf No, the expansion of the GBK there is no such thing ...
Depressed in ...
PHP.ini, this is finally found, do not know which bird people crazy cheap to the place set open, and is not correct, which place?
Default_charset = "GBK"
In this place, I killed Lao Tzu! It is then modified to:
Default_charset = "Utf-8″
Reboot, everything's fine! But we're not going to kill each other. No, just think about it. No, everything is normal after it is removed-the page displays the control of the encoding back to the page itself.
http://www.bkjia.com/PHPjc/632261.html www.bkjia.com true http://www.bkjia.com/PHPjc/632261.html techarticle haven't written PHP for a long time today when suddenly its strange garbled error reproduced is I wonder Ah! , let's look at my troubleshooting methods and give a reference to a friend who has the same problem. Have a ...