2

I am trying to install moodle but it shows php-gd extension is missing/should be enabled. However the gd is already installed and latest, and when I command php -v I get the following error as indicated below.

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

I did a lot of editing but I could not find a single solution. Please help

12
  • what is the output of this command: php -m | grep gd Commented May 6, 2020 at 15:11
  • 1
    How did you install the gd module? Commented May 6, 2020 at 15:14
  • here is the ouput for rpm -qa|grep gd and i used yum install php-gdgdm-gdm-3.8.4-27.el7.x86_64 gd-last-2.3.0-1.el7.remi.x86_64 libgdither-0.6-8.el7.x86_64 php-gd-7.3.17-1.el7.remi.x86_64 gdisk-0.8.6-4.el7.x86_64 gdbm-1.10-8.el7.x86_64 libs-3.8.4-27.el7.x86_64 gd-devel-2.0.35-26.el7.x86_64 gupnp-igd-0.2.2-3.el7.x86_64 gdb-7.6.1-51.el7.x86_64 gd-2.0.35-26.el7.x86_64 pulseaudio-gdm-hooks-3.0-22.el7.x86_64 cgdcbxd-1.0.2-5.el7.x86_64 php73-php-gd-7.3.17-1.el7.remi.x86_64 libgdata-0.13.3-4.el7.x86_64 gdk-pixbuf2-2.28.2-4.el7.x86_64 @DavidHlavati Commented May 6, 2020 at 15:24
  • if i run php -m | grep gd //I GET //// 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 Commented May 6, 2020 at 15:33
  • 1
    Did you install all of the listed packages? Commented May 6, 2020 at 15:33

2 Answers 2

6

I had the same problem:

# 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

A quick search in google told me that hb_ft_font_set_load_flags comes from HarfBuzz (https://harfbuzz.github.io/harfbuzz-hb-ft.html).

I installed it with yum install harfbuzz, and after that the warning is gone:

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
Sign up to request clarification or add additional context in comments.

Comments

3

Run:

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 provided by libraqm-devel.

Install libraqm-devel will also install freetype and harfbuzz, which provide hb_ft_font_set_load_flags.

1 Comment

Please add some explanation to your answer such that others can learn from it

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.