Score:0

Debian: how to put two versions of libcurl on one system?

jp flag

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?

Score:1
in flag

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

Robert Grubba avatar
jp flag
unfortunately, I am not allowed to use containers in that project...
Nikita Kipriyanov avatar
za flag
Are you sure you're in business environment?
Score:0
jp flag

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
in flag
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.
Score:-2
ru flag

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

in flag
That doesn't make any sense at all.
Robert Grubba avatar
jp flag
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.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.