{"id":15027728,"url":"https://github.com/tob1as/docker-php","last_synced_at":"2025-04-09T20:22:41.995Z","repository":{"id":58758188,"uuid":"74487522","full_name":"Tob1as/docker-php","owner":"Tob1as","description":"PHP (with Apache2 or FPM or NGINX) - Docker Image for amd64, arm64, arm (Raspberry Pi)","archived":false,"fork":false,"pushed_at":"2024-11-22T21:06:56.000Z","size":142,"stargazers_count":11,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T22:14:23.211Z","etag":null,"topics":["apache2","docker","dockerfile","fpm","httpd","nginx","nginx-php-fpm","php","php-docker","php-fpm","php8","supervisord","webserver"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/tobi312/php/","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Tob1as.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":"2016-11-22T15:42:11.000Z","updated_at":"2024-11-22T21:07:00.000Z","dependencies_parsed_at":"2025-02-15T20:33:37.899Z","dependency_job_id":"62525ca2-f5e2-492f-97ab-5b72b37bc6b7","html_url":"https://github.com/Tob1as/docker-php","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tob1as%2Fdocker-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tob1as%2Fdocker-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tob1as%2Fdocker-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tob1as%2Fdocker-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tob1as","download_url":"https://codeload.github.com/Tob1as/docker-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248104850,"owners_count":21048411,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","docker","dockerfile","fpm","httpd","nginx","nginx-php-fpm","php","php-docker","php-fpm","php8","supervisord","webserver"],"created_at":"2024-09-24T20:06:57.219Z","updated_at":"2025-04-09T20:22:41.965Z","avatar_url":"https://github.com/Tob1as.png","language":"Dockerfile","readme":"# PHP (with Apache2 or FPM or NGINX) on x86_64 and ARM\n\n### Supported tags and respective `Dockerfile` links\n- [`8.X-fpm-alpine-slim` (*Dockerfile*)](https://github.com/Tob1as/docker-php/blob/master/alpine.fpm.slim.Dockerfile)\n- [`8.X-fpm-alpine` (*Dockerfile*)](https://github.com/Tob1as/docker-php/blob/master/alpine.fpm.Dockerfile)\n- [`8.X-fpm-nginx-alpine-slim` (*Dockerfile*)](https://github.com/Tob1as/docker-php/blob/master/alpine.fpm_nginx.slim.Dockerfile)\n- [`8.X-fpm-nginx-alpine` (*Dockerfile*)](https://github.com/Tob1as/docker-php/blob/master/alpine.fpm_nginx.Dockerfile)\n- [`8.X-fpm-nginx-alpine-extended` (*Dockerfile*)](https://github.com/Tob1as/docker-php/blob/master/alpine.fpm_nginx.extended.Dockerfile)\n- [`8.X-apache-slim` (*Dockerfile*)](https://github.com/Tob1as/docker-php/blob/master/debian.apache.slim.Dockerfile)\n- [`8.X-apache` (*Dockerfile*)](https://github.com/Tob1as/docker-php/blob/master/debian.apache.Dockerfile)\n- [`8.X-fpm-slim` (*Dockerfile*)](https://github.com/Tob1as/docker-php/blob/master/debian.fpm.slim.Dockerfile)\n- [`8.X-fpm` (*Dockerfile*)](https://github.com/Tob1as/docker-php/blob/master/debian.fpm.Dockerfile)\n\n**All container images are available in versions 8.1, 8.2, 8.3 and 8.4.** ;-)  \n  \n*How long php versions are supported (End of Life): [https://www.php.net/supported-versions.php](https://www.php.net/supported-versions.php)  \nDo not use an container image which php version is no longer supported!*\n\n### What is PHP?\n\nPHP is a server-side scripting language designed for web development, but which can also be used as a general-purpose programming language. PHP can be added to straight HTML or it can be used with a variety of templating engines and web frameworks. PHP code is usually processed by an interpreter, which is either implemented as a native module on the web-server or as a common gateway interface (CGI).\n\n\u003e [wikipedia.org/wiki/PHP](https://en.wikipedia.org/wiki/PHP)\n\n![logo](https://raw.githubusercontent.com/docker-library/docs/master/php/logo.png)\n\n### About these images:\n* based on official images: [DockerHub](https://hub.docker.com/_/php/) / [GitHub](https://github.com/docker-library/php)\n* The official base Images have the following PHP extensions enabled by default (check with: ```php -m```): ```Core ctype curl date dom fileinfo filter ftp hash iconv json libxml mbstring mysqlnd openssl pcre PDO pdo_sqlite Phar posix readline Reflection session SimpleXML sodium SPL sqlite3 standard tokenizer xml xmlreader xmlwriter zlib```\n* These images extend the basic images with additional PHP extensions, for example: SQL-Databases, gd, imagick, ldap and more. For details see in dockerfiles.\n* For easy install the extensions and get a smaller images it use [php-extension-installer](https://github.com/mlocati/docker-php-extension-installer).\n* For information about PHP and extensions see here: [php.net](https://php.net) and [pecl.php.net](https://pecl.php.net).\n\n### How to use these images:\n* ``` $ docker run --name phpcontainer -v $(pwd)/html:/var/www/html:rw -p PORT:80 -e PHP_ERRORS=1 -e PHP_UPLOAD_MAX_FILESIZE=250 -d tobi312/php:8.1-apache```\n\n* Environment Variables:  \n  * `TZ` (set timezone, example: \"Europe/Berlin\")\n  * `PHP_ERRORS` (set 1 to enable)\n  * `PHP_MEM_LIMIT` (set Value in MB, example: 128)\n  * `PHP_POST_MAX_SIZE` (set Value in MB, example: 250)\n  * `PHP_UPLOAD_MAX_FILESIZE` (set Value in MB, example: 250)\n  * `PHP_MAX_FILE_UPLOADS` (set number, example: 20)\n  * `CREATE_PHPINFO_FILE` (set 1 to enable, for dev and testing)\n  * `CREATE_INDEX_FILE` (set 1 to enable, for dev and testing)\n  * PHP-FPM (only):\n    * `ENABLE_PHP_FPM_STATUS` (set 1 to enable on `/php_fpm_status`)\n  * Apache2 (only):\n    * `ENABLE_APACHE_REWRITE` (set 1 to enable)\n    * `ENABLE_APACHE_ACTIONS` (set 1 to enable)\n    * `ENABLE_APACHE_SSL` (set 1 to enable)\n    * `ENABLE_APACHE_HEADERS` (set 1 to enable)\n    * `ENABLE_APACHE_ALLOWOVERRIDE` (set 1 to enable)\n    * `ENABLE_APACHE_REMOTEIP` (set 1 to enable (X-Forwarded-For), use this only behind a proxy/loadbalancer!)\n    * `ENABLE_APACHE_STATUS` (set 1 to enable)\n    * `ENABLE_APACHE_SSL_REDIRECT` (set 1 to enable, required enable ssl and rewrite)\n    * `APACHE_SERVER_NAME` (set server name, example: example.com)\n    * `APACHE_SERVER_ALIAS` (set server name, example: 'www.example.com *.example.com')\n    * `APACHE_SERVER_ADMIN` (set server admin, example: admin@example.com)\n    * `DISABLE_APACHE_DEFAULTSITES` (set 1 to disable default sites, then add or mount your own conf in /etc/apache2/sites-enabled)\n  * NGINX (only):\n    * `ENABLE_NGINX_REMOTEIP` (set 1 to enable (X-Forwarded-For), use this only behind a proxy/loadbalancer!)\n    * `ENABLE_NGINX_STATUS` (set 1 to enable)\n    * or mount own config to `/etc/nginx/conf.d/default.conf`\n\n* Ports:\n  * php with apache/nginx: `80` (http), optional: `443` (https)\n  * php with fpm: `9000`\n\n* An own Dockerfile?, then here an example with copy additional own entrypoint-file(s) in apache image:  \n  ``` $ echo -e \"FROM tobi312/php:8.1-apache\\nCOPY *.sh /entrypoint.d/\" \u003e Dockerfile```\n\n#### Docker-Compose\n\n```yaml\nversion: \"2.4\"\nservices:\n  php:\n    image: tobi312/php:8.1-apache\n    container_name: phpcontainer\n    restart: unless-stopped\n    ## ports ONLY with apache/nginx:\n    ports:\n      - \"80:80\"\n      - \"443:443\"\n    volumes:\n      - ./html:/var/www/html:rw\n      ## optional: folder with own entrypoint-file(s) mount:\n      #- ./entrypoint.d:/entrypoint.d:ro\n      ## optional for apache: own ssl-cert and -key:\n      #- ./ssl/mySSL.crt:/etc/ssl/certs/ssl-cert-snakeoil.pem:ro\n      #- ./ssl/mySSL.key:/etc/ssl/private/ssl-cert-snakeoil.key:ro\n      ## optional for nginx: own nginx default.conf:\n      #- ./nginx_default.conf:/etc/nginx/conf.d/default.conf:ro\n    environment:\n      TZ: \"Europe/Berlin\"\n      PHP_ERRORS: 1\n      PHP_MEM_LIMIT: 128\n      PHP_POST_MAX_SIZE: 250\n      PHP_UPLOAD_MAX_FILESIZE: 250\n      PHP_MAX_FILE_UPLOADS: 20\n      CREATE_PHPINFO_FILE: 0\n      CREATE_INDEX_FILE: 0\n      ## next env only with apache\n      ENABLE_APACHE_REWRITE: 1\n      ENABLE_APACHE_ACTIONS: 0\n      ENABLE_APACHE_SSL: 0\n      ENABLE_APACHE_HEADERS: 0\n      ENABLE_APACHE_ALLOWOVERRIDE: 1\n      ENABLE_APACHE_REMOTEIP: 0\n      ENABLE_APACHE_STATUS: 0\n      #ENABLE_APACHE_SSL_REDIRECT: 0\n      #APACHE_SERVER_NAME: \"\"\n      #APACHE_SERVER_ALIAS: \"\"\n      #APACHE_SERVER_ADMIN: \"\"\n      #DISABLE_APACHE_DEFAULTSITES: 0\n      ## next env only with nginx\n      #ENABLE_NGINX_REMOTEIP: 0\n      #ENABLE_NGINX_STATUS: 0\n```\n\n### This Image on\n* [DockerHub](https://hub.docker.com/r/tobi312/php/)\n* [GitHub](https://github.com/Tob1as/docker-php)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftob1as%2Fdocker-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftob1as%2Fdocker-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftob1as%2Fdocker-php/lists"}