https://github.com/tozd/docker-php
PHP Docker image. Read-only mirror of https://gitlab.com/tozd/docker/php
https://github.com/tozd/docker-php
docker docker-image nginx php
Last synced: about 2 months ago
JSON representation
PHP Docker image. Read-only mirror of https://gitlab.com/tozd/docker/php
- Host: GitHub
- URL: https://github.com/tozd/docker-php
- Owner: tozd
- Created: 2014-07-02T19:25:16.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2024-05-13T21:41:09.000Z (about 2 years ago)
- Last Synced: 2025-01-09T16:37:23.749Z (over 1 year ago)
- Topics: docker, docker-image, nginx, php
- Language: Dockerfile
- Homepage:
- Size: 31.3 KB
- Stars: 0
- Watchers: 5
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# tozd/php
Available as:
- [`tozd/php`](https://hub.docker.com/r/tozd/php)
- [`registry.gitlab.com/tozd/docker/php`](https://gitlab.com/tozd/docker/php/container_registry)
## Image inheritance
[`tozd/base`](https://gitlab.com/tozd/docker/base) ← [`tozd/dinit`](https://gitlab.com/tozd/docker/dinit) ← [`tozd/nginx`](https://gitlab.com/tozd/docker/nginx) ← [`tozd/nginx-mailer`](https://gitlab.com/tozd/docker/nginx-mailer) ← [`tozd/nginx-cron`](https://gitlab.com/tozd/docker/nginx-cron) ← `tozd/php`
## Tags
- `5.5`: PHP 5.5
- `5.6`: PHP 5.6
- `7.0`: PHP 7.0
- `7.1`: PHP 7.1
- `7.2`: PHP 7.2
- `7.3`: PHP 7.3
- `7.4`: PHP 7.4
- `8.0`: PHP 8.0
- `8.1`: PHP 8.1
- `8.2`: PHP 8.2
- `8.3`: PHP 8.3
- `8.4`: PHP 8.4
## Variables
- `PHP_FCGI_CHILDREN`: How many PHP workers to create. Default is 2.
- `PHP_FCGI_MAX_REQUESTS`: How many requests can each worker handle before it is restarted.
Default is 1000.
## Description
Image extending [tozd/nginx-cron](https://gitlab.com/tozd/docker/nginx-cron) image to add [PHP](https://secure.php.net/)
and PHP FCGI daemon. This means that it also includes an e-mail mailer and can run cron jobs.
Different Docker tags provide different PHP versions.
If you are extending this image, you can add a script `/etc/service/php/run.initialization`
which will be run at a container startup, after the container is initialized, but before the
PHP FCGI daemon is run.
To get nginx to serve your PHP files, you can configure it by copying the following configuration
to `/etc/nginx/sites-enabled/default`:
```nginx
server {
listen 80 default_server;
server_name _;
access_log /var/log/nginx/default_access.log json;
root /path/to/your/php/code;
index index.php;
location ~ /\. {
return 403;
}
location ~ \.php$ {
try_files $uri =404;
include fastcgi_php;
}
}
```
## GitHub mirror
There is also a [read-only GitHub mirror available](https://github.com/tozd/docker-php),
if you need to fork the project there.