Issue
Our system
I have this s.o.
# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 10 (buster)
Release: 10
Codename: buster
# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
Actual version of apache
No, we cannot upgrade it
# apache2 -v
Server version: Apache/2.4.25 (Debian)
Server built: 2019-10-13T15:43:54
This is our php
Yes php 5.6 is old and deprecated. We cannot upgrade this old legacy app
# php -v
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20131226/gd.so' - /usr/lib/php5/20131226/gd.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP 5.6.40-0+deb8u12 (cli) (built: Jun 28 2020 09:37:30)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
The problem
As you can see above
Unable to load dynamic library '/usr/lib/php5/20131226/gd.so' - /usr/lib/php5/20131226/gd.so:
But it's installed, and, both for cli and for apache2, the mods-avaiable\gd.ini
has been simlinked in the respective conf.d
.
# apt-get install php5.6-gd
Reading package lists... Done
Building dependency tree
Reading state information... Done
php5.6-gd is already the newest version (5.6.40-52+0~20210701.54+debian10~1.gbpc0026e).
In spite of this, PHP is right, there is no /usr/lib/php5/20131226/gd.so
file.
But there is a gd.so in a generic php
folder
find / -name "gd.so"
/usr/lib/php/20131226/gd.so
Question
what is the right way to enable php5.6-gd ?
Solution
Actually I did this to resolve, but i expect a better solution if available
cp /usr/lib/php/20131226/gd.so /usr/lib/php5/20131226/gd.so
cd /etc/php5/cli/conf.d
ln -s ../../mods-available/gd.ini 20-gd.ini
cd /etc/php5/apache/conf.d
ln -s ../../mods-available/gd.ini 20-gd.ini
systemctl restart apache2
It works
I still do not understand why some extensions are under /usr/lib/php5
and this one is found under /usr/lib/php
.
Answered By - realtebo