更换服务器,迁移到新版本的Centos7.4.x系列的服务器,发现验证码一直为乱码,基本判断思路基本确定是字体问题,先让开发指定了字体依然不行,查看了下系统字体,应该是调用了阿里云的默认字体导致的。
系统版本:
0 1 2 3 |
$ cat /etc/redhat-release CentOS Linux release 7.4.1708 (Core) $ uname -a Linux Practice.t4x.org 3.10.0-693.2.2.el7.x86_64 #1 SMP Tue Sep 12 22:26:13 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux |
解决方法:
0 1 2 |
$ yum install fontconfig $ mv /usr/share/fonts/lyx /tmp/ $ fc-cache -fv |
详细过程:
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
$ yum install fontconfig $ fc-list /usr/share/fonts/lyx/eufm10.ttf: eufm10:style=LyX /usr/share/fonts/lyx/cmsy10.ttf: cmsy10:style=LyX /usr/share/fonts/lyx/msam10.ttf: msam10:style=LyX /usr/share/fonts/lyx/cmmi10.ttf: cmmi10:style=LyX /usr/share/fonts/lyx/wasy10.ttf: wasy10:style=LyX /usr/share/fonts/lyx/esint10.ttf: esint10:style=LyX /usr/share/fonts/lyx/rsfs10.ttf: rsfs10:style=LyX /usr/share/fonts/lyx/stmary10.ttf: stmary10:style=LyX /usr/share/fonts/lyx/cmex10.ttf: cmex10:style=LyX /usr/share/fonts/lyx/msbm10.ttf: msbm10:style=LyX /usr/share/fonts/lyx/cmr10.ttf: cmr10:style=LyX $ mv /usr/share/fonts/lyx /tmp/ $ fc-cache -fv /usr/share/fonts: caching, new cache contents: 0 fonts, 0 dirs /usr/share/X11/fonts/Type1: skipping, no such directory /usr/share/X11/fonts/TTF: skipping, no such directory /usr/local/share/fonts: skipping, no such directory /root/.local/share/fonts: skipping, no such directory /root/.fonts: skipping, no such directory /usr/share/fonts: caching, new cache contents: 0 fonts, 0 dirs /usr/share/X11/fonts/Type1: skipping, no such directory /usr/share/X11/fonts/TTF: skipping, no such directory /usr/local/share/fonts: skipping, no such directory /root/.local/share/fonts: skipping, no such directory /root/.fonts: skipping, no such directory /var/cache/fontconfig: cleaning cache directory /var/cache/fontconfig: invalid cache file: cfde08ab28ad1d91784abb10973575e3-le64.cache-4 /root/.cache/fontconfig: not cleaning non-existent cache directory /root/.fontconfig: not cleaning non-existent cache directory fc-cache: succeeded |
申明:除非注明Byrd's Blog内容均为原创,未经许可禁止转载!详情请阅读版权申明!