Ubuntu 18.04 LTS uses openssl-1.1.1 which is not compatible with PHP 5.x. This is how to compile PHP 5.x with Ubuntu 18.04 without downgrading system-wide openssl version.
Steps
- Download older openssl source.
- compile & install the openssl into version specific directory (i.e
/usr/local/openssl-x.x.x
) - compile PHP 5.x with
--with-openssl=/usr/local/openssl-x.x.x
option.
Example
Compilation of PHP 5.4
with openssl-1.0.2
.
1. Install openssl-1.0.2
1 | $ cd /usr/local/src |
You can download other openssl version from https://www.openssl.org/source/old/
2. Install PHP 5.4.45
1 | $ cd /usr/local/src |