PHP Startup: Unable to load dynamic library 'gd'

Issues related to applications and software problems
Post Reply
wp.rauchholz
Posts: 133
Joined: 2016/11/20 11:58:45

PHP Startup: Unable to load dynamic library 'gd'

Post by wp.rauchholz » 2019/03/20 17:50:27

All worked fine, until I updated my system today (amongst others a new kernel). I rebooted the system and get now the following message:

[root@home php.d]# php -v
PHP Warning: PHP Startup: Unable to load dynamic library 'gd' (tried: /opt/remi/php72/root/usr/lib64/php/modules/gd (/opt/remi/php72/root/usr/lib64/php/modules/gd: cannot open shared object file: No such file or directory), /opt/remi/php72/root/usr/lib64/php/modules/gd.so (libwebp.so.7: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP 7.2.16 (cli) (built: Mar 5 2019 13:10: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.16, Copyright (c) 1999-2018, by Zend Technologies

There was no update of any php program during today's update.
I mande no changes to php or http configs.
The module is installed
[root@home wp.rauchholz]# rpm -qa php72-php-gd
php72-php-gd-7.2.16-1.el7.remi.x86_64

[root@home wp.rauchholz]# ls -al /opt/remi/php72/root/usr/lib64/php/modules/gd.so
-rwxr-xr-x 1 root root 108432 5. Mär 13:14 /opt/remi/php72/root/usr/lib64/php/modules/gd.so

and enabled
; Enable gd extension module
extension=gd

info.php
System Linux home 3.10.0-957.10.1.el7.x86_64 #1 SMP Mon Mar 18 15:06:45 UTC 2019 x86_64
Build Date Mar 5 2019 13:11:56
Server API Apache 2.0 Handler
Virtual Directory Support disabled
Configuration File (php.ini) Path /etc/opt/remi/php72
Loaded Configuration File /etc/opt/remi/php72/php.ini
Scan this dir for additional .ini files /etc/opt/remi/php72/php.d
Additional .ini files parsed ...... /etc/opt/remi/php72/php.d/20-gd.ini,......

Any idea where to start looking?
Thanks for your help.

Wolfgang

User avatar
TrevorH
Site Admin
Posts: 33220
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: PHP Startup: Unable to load dynamic library 'gd'

Post by TrevorH » 2019/03/20 17:56:05

(libwebp.so.7: cannot open shared object file: No such file or directory)
That looks like the underlying error. Running yum provides '*/libwebp.so.7' shows nothing that provides that file though I do not have Remi's repos installed so it may be something that's in there. Amending the command to look for libwebp.so.* shows that the libwebp package from the base repo supplies a /usr/lib64/libwebp.so.4.

I think it's time to ask Remi.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

wp.rauchholz
Posts: 133
Joined: 2016/11/20 11:58:45

Re: PHP Startup: Unable to load dynamic library 'gd'

Post by wp.rauchholz » 2019/03/20 19:08:43

Thx Trevor. Will follow your suggestion and report back.
The doubt I have is, what does the update have to do with this.
Literally it worked until the update and 5 mins later after reboot it didn‘t anymore.

User avatar
remirepo
Posts: 447
Joined: 2014/09/21 09:07:12
Location: France
Contact:

Re: PHP Startup: Unable to load dynamic library 'gd'

Post by remirepo » 2019/03/21 06:25:18

Better place to ask => https://forum.remirepo.net/

I don't even understand how you can get to this situation.
Indeed, the gd update "requires" the new libwebp7 library.

Code: Select all

$ rpm -qp --requires enterprise/7/remi/x86_64/gd-last-2.2.5-8.el7.remi.x86_64.rpm
libwebp.so.7()(64bit)
...
$ rpm -qp --provides enterprise/7/safe/x86_64/libwebp7-1.0.2-1.el7.remi.x86_64.rpm
libwebp.so.7()(64bit)
...

Did you "force" installation.

BTW, libwebp is in the same repository than libgd, and should be pulled by yum.



P.S. for context, some PHP component update will require libwebp > 1, and for consistency of the stack, and to avoid mixing versions in the same process, all components have to switch to this new version (gd, imagick, vips).
Remi's Repository - Forum - Blog

wp.rauchholz
Posts: 133
Joined: 2016/11/20 11:58:45

Re: PHP Startup: Unable to load dynamic library 'gd'

Post by wp.rauchholz » 2019/03/21 07:53:58

I don't know how I got there either.
Installing libwebp7-1.0.2-1.el7.remi.x86_64 fixed the problem.

I reviewed /var/log/yum.log for hints, but can't find any uninstall or erase that would explain the missing file.

Thanks for the support.
Wolfgang

Post Reply