{"id":43069204,"url":"https://github.com/shinsenter/php","last_synced_at":"2026-01-31T13:49:20.815Z","repository":{"id":38450528,"uuid":"458053748","full_name":"shinsenter/php","owner":"shinsenter","description":"📦 Simplified PHP Docker images for easy customization and extension setup. Supports PHP 5.6 to 8.5 in CLI, ZTS, FPM, FPM/Apache2, FPM/Nginx, RoadRunner and FrankenPHP variants, available in both Debian and Alpine. Built daily.","archived":false,"fork":false,"pushed_at":"2025-11-27T04:52:48.000Z","size":1418,"stargazers_count":288,"open_issues_count":1,"forks_count":30,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-11-30T00:51:57.945Z","etag":null,"topics":["docker-frankenphp","docker-laravel","docker-php","docker-php-alpine","docker-php-apache","docker-php-apps","docker-php-cli","docker-php-debian","docker-php-fpm","docker-php-frankenphp","docker-php-mini","docker-php-nginx","docker-php-nginx-unit","docker-php-roadrunner","docker-php-servers","docker-roadrunner","docker-s6-overlay","docker-symfony","docker-wordpress","php"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/shinsenter/php","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shinsenter.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["shinsenter"],"custom":["https://www.paypal.me/shinsenter"]}},"created_at":"2022-02-11T05:10:22.000Z","updated_at":"2025-11-27T04:52:38.000Z","dependencies_parsed_at":"2023-02-19T03:30:59.484Z","dependency_job_id":"2f744c62-436d-4118-9226-f44d8d944088","html_url":"https://github.com/shinsenter/php","commit_stats":null,"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"purl":"pkg:github/shinsenter/php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinsenter%2Fphp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinsenter%2Fphp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinsenter%2Fphp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinsenter%2Fphp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shinsenter","download_url":"https://codeload.github.com/shinsenter/php/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinsenter%2Fphp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28944789,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T13:02:32.153Z","status":"ssl_error","status_checked_at":"2026-01-31T13:00:07.528Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["docker-frankenphp","docker-laravel","docker-php","docker-php-alpine","docker-php-apache","docker-php-apps","docker-php-cli","docker-php-debian","docker-php-fpm","docker-php-frankenphp","docker-php-mini","docker-php-nginx","docker-php-nginx-unit","docker-php-roadrunner","docker-php-servers","docker-roadrunner","docker-s6-overlay","docker-symfony","docker-wordpress","php"],"created_at":"2026-01-31T13:49:20.167Z","updated_at":"2026-01-31T13:49:20.802Z","avatar_url":"https://github.com/shinsenter.png","language":"Shell","readme":"# PHP Docker Images \u003c!-- omit from toc --\u003e\n📦 Simplified PHP Docker images for effortless customization and extension setup.\n\nOur Docker images cover PHP versions from 5.6 to 8.5 (beta), available in CLI, ZTS, FPM, FPM/Apache2, FPM/Nginx, RoadRunner and FrankenPHP variants. The Docker images are available for both Debian and Alpine versions.\n\n- Docker Hub: https://hub.docker.com/r/shinsenter/php\n- GitHub Packages: https://code.shin.company/php/pkgs/container/php\n- You can also find and use [other pre-built Docker images for some popular PHP applications and frameworks here](https://hub.docker.com/u/shinsenter).\n\n[![Daily build](https://code.shin.company/php/actions/workflows/build-all.yml/badge.svg)](https://code.shin.company/php/actions/workflows/build-all.yml)\n\n\n## Table of Contents \u003c!-- omit from toc --\u003e\n- [Introduction](#introduction)\n- [Docker Image Variants](#docker-image-variants)\n- [Customizing Settings via Environment Variables](#customizing-settings-via-environment-variables)\n- [Pre-installed PHP Extensions](#pre-installed-php-extensions)\n- [Adding PHP Extensions](#adding-php-extensions)\n- [Application Directory](#application-directory)\n- [Customizing Container User and Group in Docker](#customizing-container-user-and-group-in-docker)\n- [Hooks](#hooks)\n- [Autorun Scripts](#autorun-scripts)\n- [Using Cron Jobs](#using-cron-jobs)\n- [Customize Supervisor Command](#customize-supervisor-command)\n- [Sending Emails](#sending-emails)\n- [Debug Mode](#debug-mode)\n- [Other System Settings](#other-system-settings)\n- [Supported Platforms](#supported-platforms)\n- [Stable Image Tags](#stable-image-tags)\n- [Contributing](#contributing)\n- [License](#license)\n\n\n## Introduction\n\n[![shinsenter/php](https://repository-images.githubusercontent.com/458053748/5a05c8e4-1c00-440c-98f1-2cd4548bbaa2)](https://docker.shin.company/php)\n\nOur PHP Docker images are based on the [official PHP Docker images](https://hub.docker.com/_/php).\nThese images facilitate the easy adjustment of PHP and PHP-FPM settings using environment variables,\neliminating the need to rebuild images when making configuration changes.\n\nThese images also come with the latest version of [Composer](https://getcomposer.org)\nand popular web servers like [Apache2](https://httpd.apache.org), [Nginx](https://nginx.org), [RoadRunner](https://roadrunner.dev) or [FrankenPHP](https://frankenphp.dev).\nThis setup allows for faster project initiation without additional installations.\n\n\u003e 🪶 Info: While built on the official PHP images and including more useful extensions,\n\u003e we have **significantly reduced the image sizes** compared to the base images.\n\u003e This optimization improves download times and resource usage without sacrificing functionality,\n\u003e thanks to the [docker-squash](https://code.shin.company/docker-squash) project.\n\n\n## Docker Image Variants\n\nOur image tags cover PHP versions from 5.6 to 8.5,\navailable in `cli`, `zts`, `fpm`, `fpm-nginx`, `fpm-apache`, `roadrunner`\u003csup\u003e(1)\u003c/sup\u003e, and `frankenphp`\u003csup\u003e(2)\u003c/sup\u003e variants. The Docker images are available for both Debian and Alpine versions.\n\nExamples:\n- `shinsenter/php:8.3-cli`\n- `shinsenter/php:8.4-zts`\n- `shinsenter/php:8.5-fpm`\n- `shinsenter/php:8.1-fpm-apache`\n- `shinsenter/php:8.2-fpm-nginx`\n- `shinsenter/php:8.3-roadrunner` \u003csup\u003e(1)\u003c/sup\u003e\n- `shinsenter/php:8.4-frankenphp` \u003csup\u003e(2)\u003c/sup\u003e\n\n\u003e \u003csup\u003e(1)\u003c/sup\u003e: PHP with RoadRunner server. The `roadrunner` variant supports PHP \u003e= 8.0.\u003cbr\u003e\n\u003e \u003csup\u003e(2)\u003c/sup\u003e: FrankenPHP is still in BETA. The `frankenphp` variant supports PHP \u003e= 8.2.\u003cbr\u003e\n\nExplore all available tags on our [Docker Hub](https://hub.docker.com/r/shinsenter/php/tags).\n\n\n### Examples \u003c!-- omit from toc --\u003e\n\nYou can easily run a container by copying and pasting one of these `docker run` commands:\n\n\n#### CLI \u003c!-- omit from toc --\u003e\n\n```shell\n# non-interactive\ndocker run --rm shinsenter/php:8.5-cli php -m\n\n# interactive\ndocker run -it -v ./myproject:/var/www/html shinsenter/php:8.5-cli\n```\n\n\n#### PHP-FPM \u003c!-- omit from toc --\u003e\n\n```shell\ndocker run -v ./myproject:/var/www/html -p 9000:9000 shinsenter/php:8.5-fpm\n```\n\n\n#### PHP-FPM + Nginx (or Apache, RoadRunner, FrankenPHP) \u003c!-- omit from toc --\u003e\n\n```shell\n# with Nginx\ndocker run -v ./myproject:/var/www/html -p 80:80 -p 443:443 shinsenter/php:8.5-fpm-nginx\n\n# with Apache\ndocker run -v ./myproject:/var/www/html -p 80:80 -p 443:443 shinsenter/php:8.5-fpm-apache\n\n# with RoadRunner\ndocker run -v ./myproject:/var/www/html -p 80:80 -p 443:443 shinsenter/php:8.4-roadrunner\n\n# with FrankenPHP\ndocker run -v ./myproject:/var/www/html -p 80:80 -p 443:443 shinsenter/php:8.4-frankenphp\n```\n\n\n## Customizing Settings via Environment Variables\n\nThese images allow customizing PHP and PHP-FPM settings through environment variables instead of rebuilding images.\n\nThe environment variable names follow these conventions:\n- Variables are prefixed with `PHP_` to avoid conflicts with other application variables.\n- The rest of the variable name matches the configuration directive name from `php.ini` or `php-fpm.conf`:\n    - PHP ini directives: https://www.php.net/manual/en/ini.list.php\n    - PHP-FPM directives: https://www.php.net/manual/en/install.fpm.configuration.php\n- Directive names are converted to `CONSTANT_CASE` - uppercase with underscores instead of dots or dashes.\n\nThis naming convention helps you easily identify which environment variable applies to which PHP/PHP-FPM configuration directive.\n\n\u003e 👉🏻 Info: By default, the `$PHP_*` environment variables only take effect when set before starting the container.\n\u003e To dynamically change PHP configurations using `$PHP_*` environment variables while running commands within the container,\n\u003e you need to start your container with the `ALLOW_RUNTIME_PHP_ENVVARS=1` environment variable.\n\n\u003e 💡 Hint: Run `php-envvars` in the container to get a full list of default `$PHP_*` environment variables.\n\n\n### Examples \u003c!-- omit from toc --\u003e\n\n\n#### Command Line \u003c!-- omit from toc --\u003e\n\n```shell\ndocker run \\\n    -v ./myproject:/var/www/html \\\n    -e PHP_DISPLAY_ERRORS='1' \\\n    -e PHP_POST_MAX_SIZE='100M' \\\n    -e PHP_UPLOAD_MAX_FILESIZE='100M' \\\n    -e PHP_SESSION_COOKIE_HTTPONLY='1' \\\n    shinsenter/php:8.5 php -i\n```\n\n\n#### With docker-compose.yml \u003c!-- omit from toc --\u003e\n\n```yaml\nservices:\n  web:\n    image: shinsenter/php:8.5-fpm-nginx\n    environment:\n      PHP_DISPLAY_ERRORS: \"1\"\n      PHP_POST_MAX_SIZE: \"100M\"\n      PHP_UPLOAD_MAX_FILESIZE: \"100M\"\n      PHP_SESSION_COOKIE_HTTPONLY: \"1\"\n```\n\n\n#### Explanation \u003c!-- omit from toc --\u003e\n\n| Environment Variable          | Explanation                                        | Equivalent Configuration    |\n|-------------------------------|----------------------------------------------------|-----------------------------|\n| PHP_DISPLAY_ERRORS=1          | Enables displaying errors during development.      | `display_errors 1`          |\n| PHP_POST_MAX_SIZE=100M        | Increases the maximum post size from the default 8MB.          | `post_max_size 100M`        |\n| PHP_UPLOAD_MAX_FILESIZE=100M  | Increases the maximum upload file size from the default 2MB.   | `upload_max_filesize 100M`  |\n| PHP_SESSION_COOKIE_HTTPONLY=1 | Enables the HttpOnly flag for session cookie security. | `session.cookie_httponly 1` |\n\n\u003e 💡 Hint: Run `php-envvars` in the container to get a full list of default `$PHP_*` environment variables.\n\n\n## Pre-installed PHP Extensions\n\nPopular PHP extensions are pre-installed by default, allowing projects to get started faster without additional installation.\n\n```list\napcu\nbcmath\ncalendar\nexif\ngd\ngettext\nigbinary\nintl\nmsgpack\nmysqli\nopcache\npcntl\npdo_mysql\npdo_pgsql\npgsql\nredis\nsodium\ntidy\nuuid\nyaml\nzip\n```\n\n\u003e 👉🏻 Info: The pre-installed PHP extensions from the official Docker images are excluded from this list.\n\n\u003e 💡 Hint: Run `docker run --rm shinsenter/php:8.5-cli php -m` in the container\nto get a list of extensions (you can replace `8.5` with a specific PHP version).\n\n\n## Adding PHP Extensions\n\nThese images use a simple command called `phpaddmod` to install PHP extensions.\n\nYou don't need to run the more complex `docker-php-ext-install` command\nor manually edit the `php.ini` file; `phpaddmod` handles the installation and configuration for you.\n\nFor example, in your `Dockerfile`:\n\n```Dockerfile\nFROM shinsenter/php:8.5-fpm-nginx\n\n# Install imagick, swoole and xdebug\nRUN phpaddmod imagick swoole xdebug\n\n# Add your instructions here\n# For example:\n# ADD --chown=$APP_USER:$APP_GROUP ./myproject/ /var/www/html/\n```\n\n\u003e 👉🏻 Info: The `phpaddmod` command is a wrapper around the [`mlocati/docker-php-extension-installer`](https://github.com/mlocati/docker-php-extension-installer) utility,\nwhich takes care of all required steps to compile and activate the extensions.\n\n\u003e 💡 Hint: If you're having trouble figuring out which extensions can be installed,\nhave a look at [their documentation](https://github.com/mlocati/docker-php-extension-installer/blob/master/README.md#supported-php-extensions).\n\n\n## Application Directory\n\nThe default application directory is `/var/www/html` and can be customized via the `$APP_PATH` environment variable:\n\n```shell\ndocker run -p 80:80 -p 443:443 -p 443:443/udp \\\n    -v \"$PWD\":/app \\\n    -e APP_PATH=/app \\\n    shinsenter/php:8.5-fpm-nginx\n```\n\nThis changes the web application directory to `/app`.\n\nMoreover, the default document root\n(a relative path inside the `$APP_PATH` (application directory) that contains your `index.php` file)\ncan be customized by setting the `$DOCUMENT_ROOT` environment variable:\n\n```shell\ndocker run -p 80:80 -p 443:443 -p 443:443/udp \\\n    -v \"$PWD\":/app \\\n    -e APP_PATH=/app \\\n    -e DOCUMENT_ROOT=public \\\n    shinsenter/php:8.5-fpm-nginx\n```\n\nThis would change the document root path to `/app/public`.\n\n\n## Customizing Container User and Group in Docker\n\nOverride the default user and group settings by setting environment variables when running the container.\n\nAvailable variables:\n\n| Environment Variable | Description                             | Default          |\n|----------------------|-----------------------------------------|------------------|\n| `APP_USER`           | Username inside the container           | `www-data`       |\n| `APP_GROUP`          | Group name inside the container         | `www-data`       |\n| `APP_UID`            | Numeric UID of the user                 | UID in container |\n| `APP_GID`            | Numeric GID of the group                | GID in container |\n\nFor example, to run a container as user `myapp` with UID `5000`:\n\n```shell\ndocker run -p 80:80 -p 443:443 -p 443:443/udp \\\n    -e APP_USER=myapp \\\n    -e APP_UID=5000 \\\n    shinsenter/php:8.5-fpm-nginx\n```\n\nOr in a `docker-compose.yml`:\n```yaml\nservices:\n  web:\n    image: shinsenter/php:8.5-fpm-nginx\n    environment:\n      APP_USER: \"myapp\"\n      APP_UID: \"5000\"\n```\n\n\n## Hooks\n\nHooks are useful for customizing the behavior of a running container.\u003cbr/\u003e\nThese images support the following hooks:\n\n| Hook name   | Description                                          | Example usage              |\n|-------------|------------------------------------------------------|----------------------------|\n| `onboot`    | Runs when the container starts or restarts.          | Send startup notification. |\n| `first-run` | Runs only the first time the container starts.       | Initialize database.       |\n| `rebooted`  | Runs whenever the container restarts.                | Check crash logs.          |\n| `migration` | Runs migration scripts.                              | Run DB migrations.         |\n| `onready`   | Runs after `migration`, when the app is nearly ready.| Warm up caches.            |\n| `onlive`    | Runs after the web server starts (if included).      | Trigger webhook.           |\n\nTo use hooks, create a `hooks` folder inside `$APP_PATH` and add executable files named after the hook, or in subfolders with the same name.\nExample: to install PHP modules at `first-run`, add a script `hooks/first-run` or `hooks/first-run/install-modules`.\n\nSet `DEBUG=1` to see which hooks are executed.\n\n\n## Autorun Scripts\n\nShell scripts placed in the `/startup/` directory will automatically run when the container starts, in alphabetical order by filename.\nThis feature can initialize projects before the main program runs, saving time by executing initialization scripts automatically.\n\n\n#### Usage Example \u003c!-- omit from toc --\u003e\n\nCopy a script called `00-migration` into `/startup/` via a Dockerfile:\n\n\u003e Note: Ensure the script has executable permissions.\n\n```Dockerfile\nFROM shinsenter/php:8.5-cli\n\nADD ./autorun/00-migration /startup/00-migration\nRUN chmod +x /startup/00-migration\n\n# Add your instructions here\n# For example:\n# ADD --chown=$APP_USER:$APP_GROUP ./myproject/ /var/www/html/\n```\n\n\u003e 👉🏻 Info: The startup directory already includes a script called `99-greeting` that prints a welcome message when the container starts.\n\n\n#### Disable Autorun Scripts \u003c!-- omit from toc --\u003e\n\nTo disable autorun scripts, set `DISABLE_AUTORUN_SCRIPTS=1` as an environment variable.\n\nFor example, with `docker run`:\n\n```shell\ndocker run -e DISABLE_AUTORUN_SCRIPTS=1 shinsenter/ubuntu-s6:latest bash\n```\n\nOr in `docker-compose.yml`:\n\n```yaml\nservices:\n  web:\n    image: shinsenter/ubuntu-s6:latest\n    environment:\n      DISABLE_AUTORUN_SCRIPTS: \"1\"\n```\n\n\n## Using Cron Jobs\n\n\u003e **Note**: This is a supporting feature. If you require more advanced capabilities beyond basic `crontab` functionality, please consider building your own Docker image and installing an alternative scheduling tool (e.g., [supercronic](https://github.com/aptible/supercronic)) that better suits your needs.\n\nTo enable cron jobs in containers, you can start the container with `ENABLE_CRONTAB=1`.\nThis setting activates the Crontab service, which loads settings from the directory specified by `$CRONTAB_DIR` (default is `/etc/crontab.d`).\n\nThe cron jobs will run as the user defined by `$APP_USER:$APP_GROUP`, which by default is `www-data:www-data`,\nand with the home directory set by `$CRONTAB_HOME` (default is `/var/www/html`).\n\nHere is an example Dockerfile to add a crontab:\n\n```Dockerfile\nFROM shinsenter/php:latest\n\nENV ENABLE_CRONTAB=1\n\n# create crontab entry via RUN instruction\nRUN echo '* * * * * echo \"echo This line will run every minute!\" | tee /tmp/cron-every-minute.txt' \u003e\u003e /etc/crontab.d/sample1;\n\n# or copy crontab entries via ADD instruction\nADD ./sample2 /etc/crontab.d/\n```\n\nThe format of a crontab entry is as follows:\n\n```\n# Job definition:\n# .---------------- minute (0 - 59)\n# |  .------------- hour (0 - 23)\n# |  |  .---------- day of month (1 - 31)\n# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...\n# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat\n# |  |  |  |  |\n# *  *  *  *  *  command to be executed\n```\n\nYou can also easily set up cron jobs through the `$CRONTAB_SETTINGS` environment variable in the `docker-compose.yml` file.\nWhen the container starts, these settings are loaded into crontab, giving you more flexibility to change them later.\n\n```yml\nservices:\n  web:\n    image: shinsenter/php:8.5-fpm-nginx\n    environment:\n      ENABLE_CRONTAB: \"1\"\n      CRONTAB_SETTINGS: \"* * * * * echo 'This line will run every minute!' | tee /tmp/cron-every-minute.txt\"\n```\n\nFor more information on environment variables for cron jobs, refer to the [Other System Settings](#other-system-settings) section below.\n\n\n## Customize Supervisor Command\n\nWe can set a `$SUPERVISOR_PHP_COMMAND` environment variable to the service definition in your application's `docker-compose.yml` file.\nThis environment variable will contain the command that the container will use to serve your application using another process instead of the default process.\n\n\n#### Command Line \u003c!-- omit from toc --\u003e\n\n```shell\ndocker run \\\n    -e SUPERVISOR_PHP_COMMAND='php -S localhost:80 index.php' \\\n    shinsenter/php:8.5\n```\n\n\n#### With docker-compose.yml \u003c!-- omit from toc --\u003e\n\n```yml\nservices:\n  web:\n    image: shinsenter/php:8.5\n    environment:\n      SUPERVISOR_PHP_COMMAND: \"php -S localhost:80 index.php\"\n```\n\n\n## Sending Emails\n\nIn these Docker images, `sendmail` has been replaced by `msmtp` for sending emails.\nYou can send emails using common PHP libraries like [PHPMailer](https://github.com/PHPMailer/PHPMailer).\n\nIf you prefer to use PHP's `mail()` function,\nyou'll need to configure SMTP using the following environment variables in your container:\n\n| Environment Variable | Description                                     | Example Value        |\n|----------------------|-------------------------------------------------|----------------------|\n| `SMTP_HOST`          | The hostname or IP address of the SMTP server.  | `smtp.gmail.com`     |\n| `SMTP_PORT`          | Port number used to connect to the SMTP server. | `587`                |\n| `SMTP_LOG`           | File path to store SMTP email logs.             | `/path/to/email.log` |\n| `SMTP_FROM`          | The sender's email address.                     | `admin@example.com`  |\n| `SMTP_USER`          | Username used for SMTP authentication.          | `your_smtp_username` |\n| `SMTP_PASSWORD`      | Password used for SMTP authentication.          | `your_smtp_password` |\n| `SMTP_AUTH`          | Whether SMTP authentication is required.        | `on`                 |\n| `SMTP_TLS`           | Whether to use TLS for secure connection.       | `on`                 |\n\n\u003e 💡 Hint: If you don't have an SMTP server available (like Gmail) to send emails,\n\u003e you can try using another container such as [Mailpit](https://hub.docker.com/r/axllent/mailpit) to act as an SMTP server.\n\u003e\n\u003e If you're using Mailpit, you only need to set the following two environment variables\n\u003e in your container: `SMTP_HOST=mailpit` and `SMTP_PORT=1025`.\n\n\n## Debug Mode\n\nEnable \"debug mode\" for more verbose logging by setting `DEBUG=1` as an environment variable.\nThis can be used both with `docker run` and in `docker-compose.yml`.\n\n\n#### Command Line \u003c!-- omit from toc --\u003e\n\n```shell\ndocker run -e DEBUG=1 shinsenter/php:8.5-fpm-nginx\n```\n\n\n#### With docker-compose.yml \u003c!-- omit from toc --\u003e\n\n```yml\nservices:\n  web:\n    image: shinsenter/php:8.5-fpm-nginx\n    environment:\n      DEBUG: \"1\"\n```\n\n\n## Other System Settings\n\nThese Docker images include additional environment variables for fine-tuning container behavior:\n\n| Setting Name                       | Default Value    | Description           | Example |\n|------------------------------------|------------------|-----------------------|---------|\n| `DEFAULT_LOG_PATH`                 | `/proc/1/fd/2`   | Specifies where logs are written. By default, logs are sent to the container’s standard output. | `/var/log/container.txt` |\n| `DEBUG` or `DEBUG_MODE`            | Not set          | Enables verbose logging when set to `1`. | `1` |\n| `TZ`                               | `UTC`            | Sets the container’s default timezone. See the [full list of timezones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). | `Asia/Tokyo` |\n| `ALLOW_RUNTIME_PHP_ENVVARS`        | Not set          | Allows `$PHP_*` environment variables to override PHP configurations at runtime. | `1` |\n| `INITIAL_PROJECT`                  | Not set          | Specifies the Composer project to create if the application directory is empty.\u003cbr\u003e※ If the value is a URL ending in `*.zip`, `*.tar.gz` or `*.git`, the container will download and extract the archive to the application directory. | `laravel/laravel` |\n| `INITIAL_PROJECT_GIT_OPTIONS`      | Not set          | The parameter will be passed to the `git clone` command if `$INITIAL_PROJECT` is set and is a URL ending with `.git`. | `-b develop` |\n| `DISABLE_AUTORUN_SCRIPTS`          | Not set          | Disables all autorun scripts when set to `1`. | `1` |\n| `DISABLE_AUTORUN_CREATING_PROJECT` | Not set          | Prevents automatic project creation when set to `1`. By default, Composer will create a project if `$INITIAL_PROJECT` is set and the application directory is empty. | `1` |\n| `DISABLE_AUTORUN_COMPOSER_INSTALL` | Not set          | Skips `composer install` during startup when set to `1`. By default, the command runs if `composer.json` exists but dependencies are missing. | `1` |\n| `DISABLE_AUTORUN_GENERATING_INDEX` | Not set          | Skips creation of `index.php` when set to `1`. By default, an `index.php` file is generated in `$DOCUMENT_ROOT` if it doesn't already exist. | `1` |\n| `DISABLE_AUTORUN_FIX_OWNER_GROUP`  | Not set          | Disables automatic correction of ownership for the application directory when set to `1`. | `1` |\n| `DISABLE_GREETING`                 | Not set          | Suppresses the startup greeting message when set to `1`. | `1` |\n| `COMPOSER_OPTIMIZE_AUTOLOADER`     | Not set          | When set to `1`, enables Composer's optimized autoloader (`--optimize-autoloader`) during install, improving performance in production. | `1` |\n| `ENABLE_SSHD`                      | Not set          | When set to `1`, enable the SSH server inside the container. | `1` |\n| `SSHD_AUTHORIZED_KEYS`             | Not set          | Public SSH keys (one per line) that will be added to the container's `~/.ssh/authorized_keys` for authentication. | `ssh-rsa XXXX...` |\n| `ENABLE_CRONTAB`                   | Not set          | Enables the Crontab service when set to `1`, loading job definitions from `$CRONTAB_DIR` (default: `/etc/crontab.d`). | `1` |\n| `ENABLE_CRONTAB_DEBUG`             | Not set          | When set to `1`, adds a debug cron job that runs every minute and prints environment variables visible to cron. | `1` |\n| `CRONTAB_DIR`                      | `/etc/crontab.d` | Directory where cron job definitions are located. Jobs run as the user specified in `$APP_USER`. | `/path/for/crontab/schedules` |\n| `CRONTAB_HOME`                     | `$APP_PATH`      | Sets the `$HOME` directory used during cron job execution. | `/path/for/crontab` |\n| `CRONTAB_MAILTO`                   | Not set          | Email address to receive cron job output. | `admin@example.com` |\n| `CRONTAB_PATH`                     | `$PATH`          | Defines the executable search path used by cron jobs. | `/path/for/crontab/bin` |\n| `CRONTAB_SETTINGS`                 | Not set          | Allows defining cron jobs directly in `docker-compose.yml`, making it easy to manage scheduled tasks inside the container. | `0 0 * * * echo \"Hello new day!\"` |\n| `CRONTAB_SHELL`                    | `/bin/sh`        | Specifies the default shell used for cron job execution. | `/bin/bash` |\n| `CRONTAB_TZ`                       | `$TZ`            | Sets the timezone for cron jobs. See the [full list of timezones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). | `Asia/Tokyo` |\n| `SUPERVISOR_PHP_COMMAND`           | Not set          | Overrides the container’s default entrypoint with a custom PHP command to serve the application. | `php -S localhost:80 index.php` |\n| `ENABLE_TUNING_FPM`                | Not enabled      | Enables automatic tuning of PHP-FPM settings when set to `1`. | `1` |\n| `ENABLE_TUNING_MPM`                | Not enabled      | Enables automatic tuning of Apache MPM settings when set to `1`. | `1` |\n\n\n## Supported Platforms\n\nCheck our [Docker Hub](https://hub.docker.com/r/shinsenter/php/tags) for all available platforms. The Docker images are available for both Debian and Alpine versions.\n\n\n## Stable Image Tags\n\nFor stable versions (with date tagged) you can depend on in production,\nwe also apply version tags on another repository.\n\n\u003e 👉🏻 View Stable Tags: https://hub.docker.com/r/shinsenter/php-archives/tags\n\n\n## Contributing\n\nIf you find these images useful, consider donating via [PayPal](https://www.paypal.me/shinsenter)\nor opening an issue on [GitHub](https://code.shin.company/php/issues/new).\n\nYour support helps maintain and improve these images for the community.\n\n\n## License\n\nThis project is licensed under the terms of the [GNU General Public License v3.0](https://code.shin.company/php/blob/main/LICENSE).\n\nPlease respect the intellectual efforts involved in creating these images.\nIf you intend to copy or use ideas from this project, proper credit is appreciated.\n\n---\n\nFrom Vietnam 🇻🇳 with love.\n","funding_links":["https://github.com/sponsors/shinsenter","https://www.paypal.me/shinsenter"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshinsenter%2Fphp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshinsenter%2Fphp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshinsenter%2Fphp/lists"}