If you feel nostalgia or you just need to run an old piece of PHP code here is a Docker image with Apache 2.2 and PHP 5.3 based on Debian Stretch:
$ docker pull kenashkov/php:5.3.29-apache-stretch # Example run script (assuming your PHP Files are in /home/local) $ docker run -it -p 80:80 -v /home/local:/web/apache-2.2/htdocs -e APACHE_RUN_USER=www-data -e APACHE_RUN_GROUP=www-data kenashkov/php:5.3.29-apache-stretch # As the www-data is the default user it can be skipped $ docker run -it -p 80:80 -v /home/local:/web/apache-2.2/htdocs
As this container is aimed for development the UID of the www-data user is set to 1000. The reason being that usually the first user account in a GNU/Linux OS is UID 1000 and this way there will be no permission issues when writing files form the container as this matches the host UID.
The source code is available here.
Veselin Kenashkov
Developer at Azonmedia
Loves PHP, frameworks and old computers. Currently interested in Swoole and Vuejs.
Latest posts by Veselin Kenashkov (see all)
- CentOS roadmap changes already made impact - December 12, 2020
- Docker image with Apache 2.2 and PHP 5.3 - September 26, 2020
- Emulation and virtualization guides - September 24, 2020
Share if you liked it