无法在debian 10下的apache2中启用php5.6-gd



我们的系统

我有这个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/"

apache实际版本

不,我们不能升级它

# apache2 -v
Server version: Apache/2.4.25 (Debian)
Server built:   2019-10-13T15:43:54
这是我们的php

是php 5.6是旧的,已弃用。我们升级这个旧的应用程序

# 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

如你所见

无法加载动态库'/usr/lib/php5/20131226/gd。/usr/lib/php5/20131226/gd. So:

但是它已经安装,并且,对于cli和apache2,the mods-avaiablegd.ini已经在各自的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).

尽管如此,PHP是正确的,没有/usr/lib/php5/20131226/gd.so文件。

但是有一个gd。所以在通用的php文件夹

find / -name "gd.so"
/usr/lib/php/20131226/gd.so

如何启用php5.6-gd ?

实际上我这样做是为了解决,但我希望有一个更好的解决方案,如果可用

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

我仍然不明白为什么有些扩展在/usr/lib/php5下,而这个在/usr/lib/php下。

最新更新