As I had to upgrade to TLS1.2 I had to upgrade to OpenSSL 1.0.1 or higher. To do that, I had to upgrade from Ubuntu 10.04 to Ubuntu 16.04

Ubuntu 10.04 had

PHP     5.3.2 
MySQL   5.1.66 
Apache  2.2.14 
OpenSSL 0.9.8

Ubuntu 16.04 is having

PHP     7.0.18 
MySQL   5.7.18 
Apache  2.4.18 
OpenSSL 1.0.2

As expected I have OpenSSL 1.0.2 now, but the site is not working now because PHP version is upgraded to 7.0.18. Now I have few questions

  1. Can I install PHP 5.3.2 separately and run that? If so, will that use TLS 1.2?
  2. Or if I need to remove the PHP 7 to install PHP 5.3.2, OpenSSL will also be downgraded?
  3. MySQL is deprecated by some version of PHP(I don't know which version of PHP/MySQL). As my MySQL version also has upgraded, still can I access MySQL from PHP 5.3.2?

I know PHP 5.3 is EOL. But I should have that version now to run my code, but with TLS 1.2.

Shortly saying, I need

PHP 5.3.2 with access to MySQL + TLS1.2(>openssl 1.0.1) + Ubuntu 16.04.

How to achieve this?


3 Answers 3


A lot depends on if you want to only use officially supported packages.

There is nothing stopping you removing the PHP 7 package and compiling PHP 5.3.2 yourself and linking against OpenSSL 1.0.2 if you have the knowledge on how to do so. It may be easy or hard depending on API changes in dependencies. It would probably worth using 5.3.29 though, which I understand should be compatible with your 5.3.2 code but have a few more fixes.


I would check for security issues that have come up since release though before putting it live. It is not supported anymore IIUC so you would be on your own to patch it.

Because of the lack of security patches I would also advise updating the code base to something more recent ASAP. PHP publish migration guides (e.g. http://php.net/migration54) and you could follow each one until you were supported again.

I am not personally aware of any packages (official or otherwise) that would let you avoid having to compile yourself.

  • To migrate the code to support php 7 from php 5.3, I have to do some more analysis. But i think that would be the best solution for long run. Anyhow, that would be an another topic. Thanks for your time. It may help someone else.
    – siddiq
    Jun 29, 2017 at 5:54

PHP 5.3 has reached EOL. Also, I think there is no maintained repo/distro with active 5.3 support.

I think the only good bet is migrating your code to a supported PHP version, or at least 5.4/5.5. You can find the official PHP migrating guides here.

Anyway, if you need a dirty workaround, you probably have two main options:

  • Compile it yourself
  • Use a third party ppa, virtual machine or container

If you want to compile it yourself (with all the hassle it can be), linking against the newer OpenSSL and solving the potential issues this could arise, like @user133831 mentioned, you can follow the steps on this answer.

If you want to avoid compiling it and you are looking to use a ppa, you can try to install using SergeyD one's. Check the ppa instructions to install the corresponding PHP modules.

I've also seen specific third-party Docker containers for PHP 5.3 based on older Ubuntu versions, like 12.04 and 12.10 (with older OpenSSL versions too). However, you can try (and throw it away after that) a docker container to see if it works for your problem. Maybe you want to take a look these links: PHP 5.3 from scratch Dockerfile, PHP 5.3 Docker image

No matter the option you choose, I'll suggest doing all the "dirty" stuff inside a VM or lxc/lxd/docker container (at least at first), to avoid messing too much the main system.

Anyway, if you choose to stay with PHP 5.3, keep in mind that probably you'll end with other "side effects", like problems with the MYSQL API in newer versions, bugs and incompatibilities fixed in newer versions, and of course, potential security flaws.

Hope it helps.


On 16.04, I was able to force downgrade libssl-dev with this command:

apt-get install libssl-dev=1.0.2*

I was able to compile php 5.3.29 with phpbrew with the following command, after installing many lib*-dev packages:

phpbrew install 5.3.29 +everything -fpm +apxs2 -cli -cgi -phpdbg -dtrace -opcache -embed -gcov

I also had the ondrej/php ppa installed, that may have been a factor, though it really only is supposed to give you php 5.6.x, so I'm not sure.

You must log in to answer this question.

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