I’m running into an issue I hope someone can help me with.
I currently have a container with PHP 5.6-apache serving a website, and another container with nginx proxy manager forwarding traffic to it. Now I need to set up another container for a website that requires PHP 5.4.16, but my Docker installation (version 28.3.3) no longer supports pulling that image.
When I try to use a newer PHP version, some functions are deprecated or behave differently, breaking the site. I also experimented with running Docker-in-Docker with an older Docker version to launch the old PHP image, but that setup quickly became too complicated. Building own php image also didnt work for me.
My question is: Is there a simpler way to run a legacy PHP 5.4.x application in Docker today?
With an old image you the PHP versions you mentioned you would have multiple problems. One is the image format, which could be solved by an older daemon, but it didn’t always work for me. And when you try to rebuild your image, the repositories of the OS or anything might not be available. Since you already tried an older Docker version running in a Docker container, the next you could try is create a virtual machine and install an older daemon in that VM.
Or you could try to use a tool that converts an old image to a new format. I think rregctl could do it:
There is a --to-docker option and the comment says it converts to Docker schema v2.
You can also try to search for existing images that you can still download. I have a PHP 5.6 FPM image I could still pull, but 5.4 is so old, I did not have an image for that.
I managed to install php5.4 on docker now, but I’m missing a lot of modules that i require to run, how can I install them on this legacy image? (I’m new to docker)
It has probably nothing to do with Docker. You would do the same way as you did originally if the required modules are still available for that PHP version. If not available from any repository, you would need to build it from source, or find a PECL or Pear library somewhere and copy it into the image to the right location.