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 Answers 3

1

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

2
  • unfortunately, I am not allowed to use containers in that project... Apr 28, 2022 at 13:08
  • Are you sure you're in business environment? May 25, 2022 at 16:53
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
1
  • 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. May 26, 2022 at 6: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

2
  • That doesn't make any sense at all. Apr 28, 2022 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.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. Apr 28, 2022 at 13:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .