Linux server configuration PHP file download, Chinese garbled code problem, Download error, how to solve


Two pits

1. Coding problem of operating system

The default code on windows is GBK, so if the file name is in Chinese, the file name will be garbled when uploaded to Linux because the default code is UTF-8!


Solution: Rename manually

2. PHP. The default encoding in the INI configuration file is iso-8859-1

sudo vi /etc/php5/apache2/php.ini

After opening the file, press “/ default_charset” to search,

Press enter to find default_ The position of charset is modified.

Remove the comment, that is to say, “;” Remove and change iso-8859-1 to UTF-8.

Then restart Apache, sudo / etc / init d/apache2 restart


**Remember to restart Apache**

This is the end of the content. Let’s try it quickly