-1

I need to reproduce my programming production environment, so I need php version 5.4.16. The packages to this version doesn't exists at official repositories, but I can compile this version to OpenSUSE Tumbleweed, and through symbolic link to have php-7 and php-5, whether necessary. But I need to install php-openssl to version 5.4.16, which could be possible by compiling version extensions, but it requires php-devel, which requires a number of other things.

How to use this PHP version and all ecosystem in an updated distro?

Leandro Arruda
  • 141
  • 1
  • 7
  • 4
    PHP 5.4 has been unsupported for a long time. You are better off concentrating your efforts to migrating to a supported PHP version. – Tero Kilkanen Jul 28 '19 at 19:20
  • If you really want to mirror your prod environment for dev purposes, I'd install the correct version of the distro on a virtual machine and use the package management system. – ivanivan Jul 28 '19 at 22:34
  • RHEL 7 (which won't be EOL until 2024) ships with php 5.4 and receives backported security fixes from the Red Hat team, so there's still valid reasons to be be working in that version. – Kefka Jul 29 '19 at 13:08

2 Answers2

1

your best bet might be copying the disks of production into a virtual machine, just copy the files (eg using rsync) and then use a rescue image to install the boot-loader.

Jasen
  • 826
  • 6
  • 12
0

Easy, I completely understand why you want to do this. Many overlook the slight chance it might not yet be possible to migrate the PHP version, especially if it’s not your application.

Use Docker or SystemD-NSPAWN. Check the docker-hub as there might be a dockerfile already made. Essentially, what you need is a docker container with PHP5.4-FPM installed and running and the container having access to the files you’re trying to serve. Then as normal when using FPM proxy pass the php files off to FPM on the port provided by docker :)

Timothy Frew
  • 582
  • 3
  • 7
  • I was blind with the problem and didn't think about the container solutions. It's the best option to me. But I see that a fresh install of CentOS 7 brings in its repositories exactly the php referred version, that is 5.4.16. Now I have option to indicate a distro version to substitute old Debian version distro until the update the system to PHP 7. – Leandro Arruda Aug 09 '19 at 19:58