10

Last night unattended update (13/12/2024) on Ubuntu 20.04.6 LTS (focal) upgraded php7.4 from version 7.4.3-4ubuntu2.24 to 7.4.3-4ubuntu2.26.

Unfortunately, after the upgrade, the php-ldap module no longer works.

Unable to load dynamic library 'ldap.so' (tried: /usr/lib/php/20190902/ldap.so (/usr/lib/php/20190902/ldap.so: undefined symbol: RETURN_THROWS), /usr/lib/php/20190902/ldap.so.so (/usr/lib/php/20190902/ldap.so.so: cannot open shared object file

I've verified this on two different servers. I hoped it was possible to rollback but the only versions available on repositories at the moment are the latest and the base version. Does anyone have an idea where I can find the packages for a rollback? And, most importantly, where to report the problem?

*** FIXED *** The patched packages are available on "security-proposed" and I guess they will be soon released on focal-security. They are available here on launchpad.

  • i think you can report the bug here: https://bugs.php.net/ or here https://github.com/php/php-src/issues – j.c Dec 13 '24 at 11:18
  • 1
    @j.c that only works if the issue is upstream. An ubuntu update introduced a regression. – Thomas Ward Dec 14 '24 at 01:57
  • Have you checked to see if /usr/lib/php/20190902/ldap.so got moved to a different folder in /usr/lib/php with a new date? Or have you checked your php.ini file to see what folder it is searching for extensions in? I was recently updating a PHP site from 5 to 8 and the search path was wrong for me. – Magnie Mozios Dec 16 '24 at 16:28

5 Answers5

5

Replacing /usr/lib/php/20190902/ldap.so from previous version is also a solution.

Get https://pl.archive.ubuntu.com/ubuntu/pool/main/p/php7.4/php7.4-ldap_7.4.3-4ubuntu2.24_amd64.deb

Extract it :

ar x php7.4-ldap_7.4.3-4ubuntu2.24_amd64.deb

And extract ldap.so :

tar xf data.tar.xz ./usr/lib/php/20190902/ldap.so

Then copy to /usr/lib/php/20190902 :

cp /usr/lib/php/20190902/ldap.so /usr/lib/php/20190902/ldap.so

Then restart php-fpm or apache..

Worked fine for me.

4

We had the same problem. If you don't remove your cache aufter updates, you can reinstall the old packages like we did:

apt install php7.4-common=7.4.3-4ubuntu2.24 php7.4-ldap=7.4.3-4ubuntu2.24 php7.4-cli=7.4.3-4ubuntu2.24 php7.4-json=7.4.3-4ubuntu2.24 php7.4-opcache=7.4.3-4ubuntu2.24 php7.4-readline=7.4.3-4ubuntu2.24 libapache2-mod-php7.4=7.4.3-4ubuntu2.24
  • Thank you. Unfortunately the cache was deleted but I was able to find the packages here: https://launchpad.net/~ubuntu-security-proposed/+archive/ubuntu/ppa/+build/29131131 So, I could downgrade. I've also found how to report the bug and I've seen it had already been reported. Hope they'll fix it soon! – Gabriele Carioli Dec 13 '24 at 11:09
1

Following @took 's response:

Instead of upgrading the entire distribution we have decided to upgrade only what is required:

apt-get install --only-upgrade php7.4-ldap

This will trigger and upgrade for the ldap package and all related packages (we have listed our upgraded down below). The upgrade only took 1-2 minutes (hardware and internet connection might affect this estimate). After the upgrade, version 7.4.3-4ubuntu2.26 was replaced with 7.4.3-4ubuntu2.28 .

Remember to issue a restart to your depended software. For example we've restarted apache2 (systemctl restart apache2), but you may need to restart other services as well (ex: php7.4-fpm).

Updated packages as a result of upgrading php7.4-ldap: libapache2-mod-php7.4 php7.4-cli php7.4-common php7.4-curl php7.4-dev php7.4-gd php7.4-json php7.4-mbstring php7.4-mysql php7.4-opcache php7.4-readline php7.4-xml

Radu
  • 11
0

We got the same error is one of our servers. We tried to do above but did not work well. We remove the PHP and reinstall the version which is support by default with the OS.

Remove PHP:

sudo apt purge php7.4* -y
sudo apt autoremove --purge -y
sudo apt autoclean

Check installed packages:

dpkg -l | grep php

Remove any leftover directories:

sudo rm -rf /etc/php
sudo rm -rf /usr/lib/php

Installing default version of the support PHP:

sudo apt install php php-mysql libapache2-mod-php php-cli php-gd php-curl php-ldap php-zip php-fileinfo php-pear php-pdo php-mysqlnd php-pgsql php-mbstring php-xml php-simplexml -y

Restart apache2

sudo systemctl restart apache2

Above steps worked well for me.

0

Fixed with php7.4-ldap (7.4.3-4ubuntu2.28), just run apt update && apt dist-upgrade again to get the latest version and everything will be fine again!

took
  • 3