{"id":15023732,"url":"https://github.com/evilwizardcreations/php5.6-apache-docker-example","last_synced_at":"2026-02-07T21:02:53.981Z","repository":{"id":205743419,"uuid":"599191215","full_name":"EvilWizardCreations/php5.6-apache-docker-example","owner":"EvilWizardCreations","description":"A base PHP 5.6 \u0026 Apache 2 image for demonstrating legacy projects.","archived":false,"fork":false,"pushed_at":"2023-11-08T07:37:18.000Z","size":96,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-04T11:22:51.939Z","etag":null,"topics":["apache2","development","docker","docker-compose","docker-container","docker-image","dockerfile","dockerhub","dockerhub-image","legacy","legacy-application","legacy-support","php56"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/ewc2020/web/tags","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EvilWizardCreations.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-08T16:33:48.000Z","updated_at":"2024-12-14T23:55:47.000Z","dependencies_parsed_at":"2025-01-19T18:38:56.833Z","dependency_job_id":"e4bb829a-231c-4154-927c-957f3da43f9c","html_url":"https://github.com/EvilWizardCreations/php5.6-apache-docker-example","commit_stats":null,"previous_names":["evilwizardcreations/php5.6-apache-docker-example"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/EvilWizardCreations/php5.6-apache-docker-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvilWizardCreations%2Fphp5.6-apache-docker-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvilWizardCreations%2Fphp5.6-apache-docker-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvilWizardCreations%2Fphp5.6-apache-docker-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvilWizardCreations%2Fphp5.6-apache-docker-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EvilWizardCreations","download_url":"https://codeload.github.com/EvilWizardCreations/php5.6-apache-docker-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvilWizardCreations%2Fphp5.6-apache-docker-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29208176,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T20:33:12.493Z","status":"ssl_error","status_checked_at":"2026-02-07T20:30:47.381Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apache2","development","docker","docker-compose","docker-container","docker-image","dockerfile","dockerhub","dockerhub-image","legacy","legacy-application","legacy-support","php56"],"created_at":"2024-09-24T19:59:23.204Z","updated_at":"2026-02-07T21:02:53.963Z","avatar_url":"https://github.com/EvilWizardCreations.png","language":"Dockerfile","readme":"# PHP 5.6 \u0026 Apache Dockerfile Example\n\nA base PHP 5.6 Apache 2 image[^docker_pull_cmd_note] for demonstrating legacy projects available at [EWC Docker Hub](https://hub.docker.com/r/ewc2020/web).\n\nAn older version of ***PHP*** that some older codebase sites would require as an environment to run in.\n\nOther Packages Included:\n\n- Node v8.x\n- Composer v1.7.1\n- libxml2-dev\n- libzip-dev\n- libyaml-dev\n- zip\n- unzip\n- git\n- nodejs\n- default-mysql-client\n- vim\n- npm i npm@`$NPM_VERSION`[^npm_version_note] -g\n- yaml-1.3.0\n\nPHP Extensions:\n\n- gettext \n- mysqli \n- pdo_mysql \n- zip\n- yaml\n\n## Build \u0026 Compose Up\n\nNote that the `php-5-6-apache` is the Docker Compose Service to ***Build***.\n\nThere is a build script included that uses the local `.env` file \u0026 an [Evil Wizard Creations Protocol](https://bitbucket.org/evilwizardcreations/ewc-protocols) that makes this much simpler.\n\n```bash\nbuild-up-php-5-6-apache.sh\n```\n\nAlternatively there is the *full Procedure*.\n\n1. Build the Image using the `docker-compose-build.yaml` configuration.\n\n    ```bash\n    docker-compose -f ./docker-compose-build.yaml build --no-cache php-5-6-apache\n    ```\n\n1. Compose *Up* using the `docker-compose-build.yaml` configuration will use the new built Image and `-d` to *detach*.\n\n    ```bash\n    docker-compose -f ./docker-compose-build.yaml up -d\n    ```\n\n## Build Image The Long Way\n\nBuild the ***Docker Image*** without using ***cached*** versions of previous image build stages.\n\n```bash\nsudo docker build \\\n    -f php-5-6-apache.Dockerfile \\\n    --target build-php-56-apache \\\n    --build-arg APP_ENV=local \\\n    --build-arg NPM_VERSION=6.4.1 \\\n    --no-cache \\\n    -t php-5-6-apache:latest \\\n    .\n```\n\n**N.B.**\n\n- Using `-f php-5-6-apache.Dockerfile`\n\n    To specify `php-5-6-apache.Dockerfile` as the *filename* to ***build*** otherwise it is expected to be named just `Dockerfile`.\n\n- Using `--target build-php-56-apache`\n\n    To select the ***build target stage***[^multi_stage_builds_note] from the *Dockerfile*.\n\n- Using `--no-cache`\n\n    To prevent using previous ***cached*** versions of image build stages.\n    \n- Using `--build-arg NPM_VERSION=6.4.1`\n\n    To set build ***arguments*** \u0026 ***values*** to use during the build process. `NPM_VERSION=6.4.1` sets the ***Node Version*** to be used to ***6.4.1*** when rebuilding the image.\n\n- Using `-t php-5-6-apache:latest` \n\n    To ***name*** \u0026 ***tag*** the locally built docker image.\n\n- Using `.`\n\n    To set the current location as the ***build context*** for the build process.\n\n### Create A Container\n\nThis creates a named container and attaches it to the ***host network*** and may cause port conflict if the host machine is already listening on any exposed ports from the ***Docker Image*** being used.\n\n```bash\nsudo docker run \\\n    -d \\\n    --network host \\\n    -v \"$(pwd)\"/public_html:/var/www/html \\\n    --name php-5-6-apache \\\n    php-5-6-apache:latest\n```\n\n**OR**\n\nThis creates a named container and attaches it to the ***bridge network*** and allows for ***port forward mapping*** from the ***host*** to the ***Container***.\n\n```bash\nsudo docker run \\\n    -d \\\n    --network bridge \\\n    -p 8080:80/tcp \\\n    -v \"$(pwd)\"/public_html:/var/www/html \\\n    --name php-5-6-apache \\\n    php-5-6-apache:latest\n```\n\n**N.B.**\n\n- Using `-v \"$(pwd)\"/public_html:/var/www/html`\n\n    To ***Volume Mount*** the folder `public_html` from the current folder to `/var/www/html` on the ***running*** container. It is where ***Apache*** serves the content from \u0026 allows for *realtime* change updates.\n\n- Using `-p 8080:80/tcp` \n\n    To map port **8080** on the ***Host*** machine to port **80** on the ***Container*** using the ***bridge network***.\n\n- Using `--name php-5-6-apache`\n\n    To name the ***Container*** being created.\n\n### Start Container\n\n```bash\nsudo docker start php-5-6-apache\n```\n\n### Stop Container\n\n```bash\nsudo docker stop php-5-6-apache\n```\n\n## Connect To Container\n\n```bash\nsudo docker exec -it php-5-6-apache /bin/bash\n```\n\n# Disclaimer\n\nThis Apache2 + PHP 5.6 build environment should ***NOT*** be used anywhere near a ***production*** environment. This build is for showcasing legacy systems that simple would not run in modern environments \u0026 as such it is littered with security holes and exploitation's.\n\n[^docker_pull_cmd_note]: Use `docker pull ewc2020/web:php-5.6-apache-latest` to get a copy of the image.\n\n[^npm_version_note]: Uses a `.env` ***build-arg*** called ***NPM_VERSION*** to specify the npm version.\n\n[^multi_stage_builds_note]: Used mostly in ***Multi Stage*** image builds.\n\n[^compose_name_note]: The `php-5-6-apache` container name to build the image for.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevilwizardcreations%2Fphp5.6-apache-docker-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevilwizardcreations%2Fphp5.6-apache-docker-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevilwizardcreations%2Fphp5.6-apache-docker-example/lists"}