0

I am using Wine in Linux Mint 21 which is Ubuntu 22.04 (jammy). Also PHP from ondrej. Did not figure out at first that there is a conflict. Default PHP is 8.1, using FPM. I needed PHP8.3, could install other modules but not key PHP8.3-GD due to libgd3 version mismatch. Finally could not resolve, cleared but system was left broken wihout GD which is needed for Apache site.

PHP-GD does not work. During many attempts, including forcing and editing DEB, I mistakenly force installed new version of libgd3 2.3.3 from ubuntu 24.04 which broke the system. Later reinstalled libgd3 as Ubuntu 22.04 version 2.3.0 but PHP does not load GD.

` PHP Startup: Unable to load dynamic library 'gd.so' (tried: /usr/lib/php/20210902/gd.so (libtiff.so.6: cannot open shared object file: No such file or directory) `

gd.so is present after installation. `ldd /usr/lib/php/20210902/gd.so` :

/usr/lib/php/20210902/gd.so: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.38' not found (required by /lib/x86_64-linux-gnu/libgd.so.3)
libtiff.so.6 => not found

Purging and reinstalling php-gd {or even libgd3) did not help. Ubuntu 22.04 has libtiff5, libtiff6 is wrong reference from 24.04. I guess that GLIBC_2.38 is similar, as my version is 2.35. Is it possible that php-gd is still influenced by that 24.04 references? Where does it come from? How to restore that?

EDIT: I can cheat to avoid libtiff.so.6. So more important is this:

PHP Startup: Unable to load dynamic library 'gd.so' (tried: /usr/lib/php/20210902/gd.so (/lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.38' not found (required by /lib/x86_64-linux-gnu/libgd.so.3)), /usr/lib/php/20210902/gd.so.so (/usr/lib/php/20210902/gd.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

Not sure what is going on:

% l /lib/x86_64-linux-gnu/libm.* 
-rw-r--r-- 1 root root  132 Sep 17 17:26 /lib/x86_64-linux-gnu/libm.a
-rw-r--r-- 1 root root  140 Sep 17 17:26 /lib/x86_64-linux-gnu/libm.so
-rw-r--r-- 1 root root 919K Sep 17 17:26 /lib/x86_64-linux-gnu/libm.so.6
% l /lib/x86_64-linux-gnu/libgd.*
lrwxrwxrwx 1 root root   15 Dec  3 22:46 /lib/x86_64-linux-gnu/libgd.so.3 -> libgd.so.3.0.11
-rw-r--r-- 1 root root 397K Nov 14  2024 /lib/x86_64-linux-gnu/libgd.so.3.0.8
-rw-r--r-- 1 root root 401K Apr 16  2024 /lib/x86_64-linux-gnu/libgd.so.3.0.11

There are many related topics out there , but they are different, like need to have same version for amd64 and i386, or need to clean /usr/local/lib/. ondrej archived Github which also had Discussions. I first posted at https://askubuntu.com/questions/1560438/php-gd-broken-with-wrong-dependancies-how-to-restore because there was related question there, to receive a comment that site is for pure Ubunt only. I do not see that as relevant in this case, but moving here.

9
  • 1
    who or whatever ondrej is, they have not given you a working methodof installing a working PHP. there doesn't seem to be any package conflicts involved here at all, so that's a distraction. Commented Dec 4 at 10:50
  • 1
    so to solve what you've broken, we would need to know what exactly you did when trying to install a conflicting version of GD. Commented Dec 4 at 11:19
  • @MarcusMüller FYI ondrej is a Debian developer who publishes the latest PHP packages for Debian/Ubuntu at deb.sury.org. Commented Dec 4 at 11:57
  • @AlexD thanks! Well, that packaging then doesn't help Tim if it doesn't bring a PHP that's working with the libgd that the system it's targetting has, so color me a bit skeptical on the appropriateness of that packaging. This all feels like "should be in the ubuntu and debian backports repos, and if they don't want it, needs quality issues fixed". Commented Dec 4 at 12:01
  • @MarcusMüller that packaging usually works. The primary feature of deb.sury.org is that you can install any PHP version from 5.6 to 8.5 on any supported Debian/Ubuntu, while the backports have only 8.4. The OP installed packages for Ubuntu 24.04 instead of 22.04, so it obviously broke the system. Commented Dec 4 at 12:57

2 Answers 2

2

Unless you messed up with something else than the PHP, you can get away by removing all packages from deb.sury.org.

It is easy to select them as they have deb.sury.org in their version string, so you need to run dpkg -l |grep deb.sury.org to see the list. Remove the source repository you used, do apt update, make sure there is no ondrej's repos in the output and remove all the packages matching deb.sury.org. You may need to do a forced removal if there are packages that depend on the removed packages, e.g., if you are using Apache from Ubuntu repos instead of the version provided by deb.sury.org (as recommended).

Once you cleaned this mess, make sure you follow the documentation at https://launchpad.net/~ondrej/+archive/ubuntu/php/ and use add-apt-repository ppa:ondrej/php, which selects the proper repository for your system by default. Also, pay attention to the following notes:

CAVEATS:

  1. If you are using apache2, you are advised to add ppa:ondrej/apache2
  2. If you are using nginx, you are advised to add ppa:ondrej/nginx
3
  • Thanks. But after purging all and reinstalling from Mint repo, the same error. Reason I did not use ondrej is that also php8.1-gd requires libgd3 2.3.3 so conflicting with wine. I did not notice before as I installed only 7.4 from ondrej, while keeping 8.1 from Mint. That worked until I broke now trying to add 8.3. So back to issue, this is really strange. I cannot remember details of what I was trying. Installing single package libgd3 from Ubuntu 24.04 seemed most suspicious. I also unpacked and edited php8.3-gd to change dependancy to libgd3 2.3.0 which did not help. Commented Dec 4 at 23:42
  • @TimSO you are installing a package for 24.04 on the 22.04 system. It is not going to work, it needs a newer libc, which isn't available in 22.04. Commented Dec 5 at 9:40
  • I had been installing package for 24.04. Now I am just trying to restore, without seeing where the issue is, like libm.so.6 or libgd.so.3 and what to do. Commented Dec 5 at 14:50
0

Removed libgd.so.3 files, reinstalled libgd3 and it works now. Previous purge did not help.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.