0

I'm trying to migrate two web apps on single server(debian10), both require different versions of php, and both require cURL extensions to work properly.

php5.6-curl uses libcurl v3

php8.1-curl uses libcurl v4

Firstly I've installed php5.6-curl, and when I tried to install php8.1-curl - apt throws notification that The following packages have unmet dependencies: php8.1-curl : Depends: libcurl4 (>= 7.56.1) but it is not going to be installed

If i use -f on apt, it removes php5.6-curl...

What is the most elegant way to make those two libcurl libraries available on single system?

Thanks, Robert

edit: As far as I can see, the problem is that libcurl3 and libcurl4 share the same file /usr/lib/x86_64-linux-gnu/libcurl.so.4and it changes when package is reinstaled (libcurl3<->libcurl4). The php[5.6,8.1]-fpm tries to load library, the one that gets improper libcurl.so.4 version fails and php can not use that module.

Maybe there an elegant method to force 4eg php5-curl binaries to use library from user defined path?

3 Answers3

1

Put both apps in a container that contains everything it needs.

Gerald Schneider
  • 23,274
  • 8
  • 57
  • 89
0

I found workaround myself, if you would like to solve similar problem you can go my, not the most elegant way.

  1. install all required php5.6 packets;
  2. copy directory /usr/lib to /usr/php56libs
  3. edit systemd service file in my case: systemctl edit --full php5.6-fpm
  4. under service section add Environment variable: Environment="LD_LIBRARY_PATH=/usr/php56libs"
  5. now you can install all php8.1 packets with apt (with force -f option) it will remove all conflicting libs from /usr/lib but it doesn't matter because php5.6-fpm service will use the ones from /usr/php56libs
  • PHP 5.6 has reached it's end of life in **2018**. It has not been receiving security updates since. Running outdated software is dangerous, using containers would at least add another layer of security to prevent privilege escalation. – Gerald Schneider May 26 '22 at 06:16
-2

Log into your server via SSH. Make sure you're in your user's home directory. Locate the version you wish to install Unzip the file. Navigate into this new directory. Open your .bash_profile using nano or vim. For example: Add the required file into .bash and update Update your .bash_profile to activate your new configuration. Check the location and version of curl

  • That doesn't make any sense at all. – Gerald Schneider Apr 28 '22 at 12:59
  • I'm not sure how it would help in my problem. As far as I can see, the problem is that libcurl3 and libcurl4 share the same file ```/usr/lib/x86_64-linux-gnu/libcurl.so.4```and it changes when package is reinstaled (libcurl3<->libcurl4). The php[5.6,8.1]-fpm tries to load library, the one that gets improper libcurl.so.4 version fails and php can not use that module. – Robert Grubba Apr 28 '22 at 13:01