{"id":20838396,"url":"https://github.com/reload/php-fpm","last_synced_at":"2025-05-08T20:36:23.246Z","repository":{"id":64605830,"uuid":"570475605","full_name":"reload/php-fpm","owner":"reload","description":"Docker PHP images for development.","archived":false,"fork":false,"pushed_at":"2025-05-07T04:04:32.000Z","size":728,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-07T05:19:23.382Z","etag":null,"topics":["developer-tools","development","docker","docker-compose","docker-image","php","php-fpm"],"latest_commit_sha":null,"homepage":"https://ghcr.io/reload/php-fpm","language":"Shell","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/reload.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null}},"created_at":"2022-11-25T09:30:17.000Z","updated_at":"2025-05-07T04:04:35.000Z","dependencies_parsed_at":"2024-05-23T07:28:21.992Z","dependency_job_id":"571c5b40-7eb2-4f83-a78f-a4c7c95d26d6","html_url":"https://github.com/reload/php-fpm","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/reload%2Fphp-fpm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reload%2Fphp-fpm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reload%2Fphp-fpm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reload%2Fphp-fpm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reload","download_url":"https://codeload.github.com/reload/php-fpm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253146476,"owners_count":21861410,"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":["developer-tools","development","docker","docker-compose","docker-image","php","php-fpm"],"created_at":"2024-11-18T01:10:09.646Z","updated_at":"2025-05-08T20:36:23.233Z","avatar_url":"https://github.com/reload.png","language":"Shell","readme":"# Docker PHP FPM images for development use\n\nThis is a PHP FPM Docker image tuned to be used in Docker Compose\nsetups for development environments.\n\nWe have tried to hit a sweet stuff between not doing too much magic,\nbut still be an easy fit for how we do work at [Reload\nA/S](https://reload.dk).\n\nA simple example of usage would be having a `php` service providing\nFPM like this:\n\n```yaml\nservices:\n  php:\n    image: 'ghcr.io/reload/php-fpm:8.3'\n    ports:\n      - '9000'\n    user: '${UID:-501}:${GID:-20}'\n    volumes:\n      - '.:/var/www'\n    environment:\n      USE_FEATURES: \u003e-\n        root-php-ini\n ```\n\n## PHP versions\n\nWe provide PHP 8.1, 8.2, 8.3 and 8.4 images.\n\nThe images are based on the official [`php:8.x-fpm-alpine` Docker\nimages](https://hub.docker.com/_/php). We build new images when new\nupstream versions are released.\n\nThe image has some PHP settings set for development / debugging use,\nsee\n[`debug.ini`](/blob/main/context/usr/local/etc/php/conf.d/debug.ini). They\ncan be disabled with `no-debug` feature mentioned later in this\ndocument.\n\n## User\n\nThe images are designed to be able to run as root inside the container\nor as UID `501` (macOS typical user ID) or UID `1000` (Linux typical\nuser ID). Other user ID's might work as well.\n\nThis being an image for development use, we have installed `sudo` and\nconfigured all users in the container to use it without providing a\npassword.\n\n## Volumes\n\nWe recommend mounting the project root of your repository into the\nDocker workdir, `/var/www`.\n\n## PHP Document root\n\nFPM expects PHP's document root to be located in `/var/www/web`. That\nwould be a `web` folder inside your project root if you follow our\npractice.\n\nIf you would like the document root to be located elsewhere, you\nshould set the environment variable `PHP_DOCUMENT_ROOT` to the desired\nlocation.\n\n## PHP extensions\n\nThe images come with the following extensions installed and enabled:\n\n- apcu\n- bcmath\n- calendar\n- ctype\n- curl\n- dom\n- exif\n- fileinfo\n- ftp\n- gd\n- gettext\n- iconv\n- imagick\n- intl\n- json\n- mbstring\n- memcache\n- memcached\n- mysqli\n- mysqlnd\n- opcache\n- pdo\n- pdo_mysql\n- pdo_sqlite\n- phar\n- posix\n- readline\n- redis\n- shmop\n- simplexml\n- soap\n- sockets\n- sqlite3\n- sysvmsg\n- sysvsem\n- sysvshm\n- tokenizer\n- xml\n- xmlreader\n- xmlwriter\n- xsl\n- zip\n\nIn addition, the `blackfire` (except on PHP 8.4) and `xdebug`\nextensions are installed but not enabled in the images.\n\nThe\n[php-extension-installer](https://github.com/mlocati/docker-php-extension-installer)\ntool is installed if you want to install additional extensions\nyourself.\n\n## Entry point scripts\n\nIf you place executables (e.g., by mounting them there) in\n`/etc/entrypoint.d` they will be run before starting FPM.\n\n## Reloading php-fpm\n\nIf you have changed PHP configuration or enabled or disabled some PHP\nextensions, you can restart the `php-fpm` process with the\n`/usr/local/bin/reload` command. E.g.\n\n```console\ndocker compose exec php reload\n```\n\n## \"Features\"\n\nThe images come with a concept called \"features\".\n\nFeatures a predefined entry point scripts with common functionality\nyou can opt in to using.\n\nFeatures a run before the entry point scripts mentioned before.\n\nYou opt in to using them by setting the `USE_FEATURES` to a space\nseparated list of their names.\n\n### `install-composer-extensions` feature\n\nIf you have a `composer.json` in your workdir (`/var/www`) this\nfeature will locate required dependencies on PHP extensions `ext-*`\nand install them using the aforementioned `php-extension-installer`\ntool.\n\nNotice: if this needs to install numerous libraries and do a lot of\ncompilation, this could take quite some time when creating the\ncontainer.\n\n### `root-php-ini` feature\n\nIf you have a `php.ini` in your workdir (`/var/www`) this will be\nloaded by FPM.\n\n### `no-debug` feature\n\nDisable the PHP ini settings in\n[`debug.ini`](/blob/main/context/usr/local/etc/php/conf.d/debug.ini).\n\n### `update-ca-certificates`\n\nIf your container needs to use custom CA certificates, place them in\n`/usr/local/share/ca-certificates/` using volumes and using the\nfeature `update-ca-certificates`.\n\n```yaml\nservices:\n  php:\n    image: 'ghcr.io/reload/php-fpm:8.3'\n    volumes:\n      - '.:/var/www'\n      - './my-ca.pem:/usr/local/share/ca-certificates/my-ca.pem:ro'\n    environment:\n      USE_FEATURES: \u003e-\n        update-ca-certificates\n ```\n\n## Xdebug\n\nXdebug is disabled by default, but the extension is available. To\nenable the xdebug-extension execute `/usr/local/bin/xdebug` via\nDocker, e.g.,\n\n```console\ndocker exec -it \u003ccontainer id\u003e xdebug\n```\n\nOr via Docker Compose, e.g., if the image is used by a service called\n`php`:\n\n```console\ndocker compose exec php xdebug\n```\n\nThe script keeps xdebug enabled while running and is terminated by\ntyping enter.\n\n## Blackfire\n\nTo send profiles to Blackfire, you'll need to have a Blackfire agent,\nreachable by the php-fpm image and the appropriate credentials.\n\nProviding an agent in docker compose is easy, as it's just starting\nthe original Blackfire image.\n\n```yaml\n  php:\n    image: 'ghcr.io/reload/php-fpm:8.3'\n    environment:\n      BLACKFIRE_CLIENT_ID: \u003cyour client key\u003e\n      BLACKFIRE_CLIENT_TOKEN: \u003cyour client token\u003e\n  blackfire:\n    image: 'blackfire/blackfire'\n    environment:\n      BLACKFIRE_SERVER_ID: \u003cyour server key\u003e\n      BLACKFIRE_SERVER_TOKEN: \u003cyour server token\u003e\n```\n\nThe correct ID's and tokens can be found by viewing the [Blackfire\nsetup documentation](https://blackfire.io/docs/php/configuration) when\nlogged in.\n\n## Mail\n\nThe image has [`mstmp`](https://marlam.de/msmtp/) installed. `msmtp`\nis an SMTP client.\n\nFor simple development setups, we recommend combining it with\n[Mailpit](https://github.com/axllent/mailpit):\n\n```yaml\n  php:\n    image: 'ghcr.io/reload/php-fpm:8.3'\n    environment:\n      SMTPSERVER: 'mail'\n  mail:\n    image: 'axllent/mailpit'\n    ports:\n      - '25'\n      - '80'\n    environment:\n      MP_SMTP_BIND_ADDR: '0.0.0.0:25'\n      MP_UI_BIND_ADDR: '0.0.0.0:80'\n```\n\nFor more advanced usages, you can add a system-wide configuration file\nfor msmtp at `/etc/msmtprc` in the php-fpm image.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freload%2Fphp-fpm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freload%2Fphp-fpm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freload%2Fphp-fpm/lists"}