https://github.com/programie/php-docker
A Docker image providing various PHP versions
https://github.com/programie/php-docker
Last synced: 2 months ago
JSON representation
A Docker image providing various PHP versions
- Host: GitHub
- URL: https://github.com/programie/php-docker
- Owner: Programie
- License: mit
- Created: 2023-10-18T12:24:56.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-18T13:39:09.000Z (almost 2 years ago)
- Last Synced: 2025-09-25T09:36:08.280Z (4 months ago)
- Language: Shell
- Size: 9.77 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# PHP Docker
A base PHP Docker image providing Apache, the [Sury PHP repository](https://sury.org) as well as a simple installation script to install any PHP package provided by the Sury PHP repository.
## Usage
The following example will Install PHP 8.2 with curl, gd and pdo_mysql as additional PHP extensions.
```Dockerfile
FROM ghcr.io/programie/php-docker
RUN install-php 8.2 curl gd pdo-mysql
```
## php.ini
By default, the php.ini is located at `/etc/php/${php_version}/apache2/php.ini` for Apache and `/etc/php/${php_version}/cli/php.ini` for the CLI.
Additionally, a symlink pointing to the config directory of the currently installed PHP version is created at `/etc/php/current`. In that way, it is possible to add php.ini files independently of the PHP version.
To share the same configuration between Apache and CLI, there is also a shared `global.ini` located at `/etc/php/current/global.ini`. This file is symlinked as `50-global.ini` into the conf.d folder of the Apache and CLI config directories (`/etc/php/current/apache2/conf.d/50-global.ini` and `/etc/php/current/cli/conf.d/50-global.ini`).
## Document root
The default document root is `/var/www/html` but can be changed using the environment variable `WEB_ROOT`.
## Timezone
The default timezone is `UTC` but can be changed using the environment variable `TZ`.