进入服务器目录php
[root@VM_139_218_centos /]# cd ~ [root@VM_139_218_centos ~]# vim .vimrc
在 .vimrc 文件中写入如下代码:vim
set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936 set termencoding=utf-8 set encoding=utf-8
而后打开php文件,乱码消失,能够正常使用了。 centos