我正在尝试安装moodle,但它显示php-gd扩展名丢失/应该启用。
但是gd已经安装并且是最新的,当我命令php -v
时,出现以下错误,如下所示。
PHP Warning: PHP Startup: Unable to load dynamic library 'gd.so' (tried: /usr/lib64/php/modules/gd.so (/lib64/libraqm.so.0: undefined symbol: hb_ft_font_set_load_flags), /usr/lib64/php/modules/gd.so.so (/usr/lib64/php/modules/gd.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP 7.3.17 (cli) (built: Apr 14 2020 08:29:22) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.17, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.17, Copyright (c) 1999-2018, by Zend Technologies
我做了很多编辑,但是找不到单个解决方案。请帮忙
答案 0 :(得分:4)
我遇到了同样的问题:
# php --version
PHP Warning: PHP Startup: Unable to load dynamic library 'gd' (tried: /usr/lib64/php/modules/gd (/usr/lib64/php/modules/gd: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/gd.so (/lib64/libraqm.so.0: undefined symbol: hb_ft_font_set_load_flags)) in Unknown on line 0
PHP 7.2.32 (cli) (built: Jul 8 2020 07:33:50) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.32, Copyright (c) 1999-2018, by Zend Technologies
在Google中进行的快速搜索告诉我hb_ft_font_set_load_flags
来自HarfBuzz(https://harfbuzz.github.io/harfbuzz-hb-ft.html)。
我用yum install harfbuzz
安装了它,然后警告消失了:
php --version
PHP 7.2.32 (cli) (built: Jul 8 2020 07:33:50) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.32, Copyright (c) 1999-2018, by Zend Technologies
答案 1 :(得分:2)
运行:
yum install libraqm-devel
[root@* ~]# yum provides '*/libraqm.so*'
Repository epel is listed more than once in the configuration
libraqm-0.7.0-4.el7.x86_64 : Complex Textlayout Library
Repo : epel
Matched from:
Filename : /usr/lib64/libraqm.so.0.700.0
Filename : /usr/lib64/libraqm.so.0
libraqm-devel-0.7.0-4.el7.x86_64 : Complex Textlayout Library
Repo : epel
Matched from:
Filename : /usr/lib64/libraqm.so
[root@* ~]# ll /usr/lib64/libraqm.so*
lrwxrwxrwx 1 root root 18 Jul 20 23:20 /usr/lib64/libraqm.so -> libraqm.so.0.700.0
lrwxrwxrwx 1 root root 18 Jul 18 19:00 /usr/lib64/libraqm.so.0 -> libraqm.so.0.700.0
-rwxr-xr-x 1 root root 19792 Jan 11 2020 /usr/lib64/libraqm.so.0.700.0
libraqm.so
由libraqm-devel
提供。
安装libraqm-devel
还将安装提供hb_ft_font_set_load_flags
的freetype和harfbuzz。