I have an issue trying to manually compile PHP 7.4.x on Ubuntu Server 22.04LTS.
There seems to be a compatibility problem between PHP 7.4 and OpenSSL 3.0 as the php compilation fails with various OSSL_DEPRECATEDIN_3_0
errors.
If PHP7.4 has no OpenSSl 3 support is it still possible to compile it manually on 22.04LTS?
It compiles successfully on 18.04LTS.
2
Answers
For anyone using an Ubuntu 22.04 Docker image here is the build for OpenSSL 1.1.1p and the php compilation options:
Add the following to the php compilation configure options
In short:
you can’t!You need to compile OpenSSL 1.1 from source.If I may suggest an alternative! check out docker
I have being trying to do the same to install PHP 7.4.30; the problem is caused by Ubuntu’s 22.04 usage of libssl3, libssl1.1 (the one we need) was present until impish (21.10)
In a response at serverfault.com its mentioned that:
You can use
--with-openssl
or--with-openssl-dir
to solve this problem indicating where your custom openssl build is, for example if you downloaded and built it from source in/opt/openssl
you could add the following to your build optionsDigging through some old SO answers I found this example:
After checking the official phpbrew wiki I found the following steps to compile and install OpenSSL 1.1 from source in Ubuntu 22.04:
Is worth to mention that for me: