针对每个目录设置编码
/etc/apache2/sites-available/000-default.conf
1<VirtualHost *:80> 2 3 ServerAdmin webmaster@localhost 4 DocumentRoot /var/www/html 5 6 ErrorLog ${APACHE_LOG_DIR}/error.log 7 CustomLog ${APACHE_LOG_DIR}/access.log combined 8</VirtualHost> 9 10# 增加下面这句调整编码 11AddDefaultCharset UTF-8 12 13# vim: syntax=apache ts=4 sw=4 sts=4 sr noet