I've already asked on the repository of ppa:ondrej/php on github, but they didn't provide support, so I'm guessing it has to do with ubuntu. I couldn't find anything about this online.
I'm trying to install php 5.6 on a fresh (and updated) instance of Ubuntu LTS 22.04 server with apache2. When I'm adding the ppa repository with LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php I get the following output:
Press [ENTER] to continue or Ctrl-c to cancel.
Adding deb entry to /etc/apt/sources.list.d/ondrej-ubuntu-php-jammy.list
Adding disabled deb-src entry to /etc/apt/sources.list.d/ondrej-ubuntu-php-jammy.list
Adding key to /etc/apt/trusted.gpg.d/ondrej-ubuntu-php.gpg with fingerprint 14AA40EC0831756756D7F66C4F4EA0AAE5267A6C
Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Hit:2 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:3 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Hit:4 http://archive.ubuntu.com/ubuntu jammy-security InRelease
Reading package lists... Done
E: Method https has died unexpectedly!
E: Sub-process https received signal 4.
After this all operations on apt seem to be broken:
# apt update
Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Hit:2 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:3 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Hit:4 http://archive.ubuntu.com/ubuntu jammy-security InRelease
Reading package lists... Done
E: Method https has died unexpectedly!
E: Sub-process https received signal 4.
To return to normal operating conditions I have to to execute add-apt-repository -r ppa:ondrej/php
Note that I tried ppa:ondrej/apache2 too, but with the same results. All commands are executed with root privileges.
Am I missing something here? I've tried the same exact installation but on Ubuntu LTS 20.04 and it works just fine.