A custom image with PHP, based on Alpine Linux with S6 overlay.
| Image | PHP | Info |
|---|---|---|
| roeldev/php-cli:7.1-latest | 7.1.28 | |
| roeldev/php-cli:7.2-latest | 7.2.17 | |
| roeldev/php-cli:7.3-latest | 7.3.4 | |
| roeldev/php-cli:7.4-rc-latest | 7.4.0alpha1 |
Below is the result from php -m, a list of the modules that are installed by default:
| Core | libxml | SimpleXML |
| ctype | mbstring | sodium |
| curl | openssl | SPL |
| date | pcre | standard |
| dom | PDO | tokenizer |
| fileinfo | Phar | xml |
| filter | phpdb_webhelper | xmlreader |
| hash | posix | xmlwriter |
| iconv | readline | zip |
| json | Reflection | zlib |
It is possible to install additional modules when the container is initialized by setting the PHP_EXTENSIONS environment variable. Extension names should not include a php or release version and must be comma separated without trailing comma. Example: PHP_EXTENSIONS="sockets,yaml". See the links section for a list of extensions that can be installed from PHP.earth.
The following php.ini directives are changed from their default values:
| Name | Value |
|---|---|
| expose_php | off |
| date.timezone | UTC |
The installer scripts within this container are meant as a starting point for usage in local development images or with Docker multi builds. Usage within production images is not recommended.
Run /usr/local/bin/install_composer.sh to download the official Composer install script. It is stored in /etc/composer/ together with the installer's signature. The install_composer.sh script will check if the signature matches and executes the installer. The Composer executable is moved to /usr/local/bin/ and is ready to be used.
Make sure to add
/root/.composer/vendor/binto your PATH if you'd like to make use of binaries from global packages.
After installing Composer it is possible to install some default devkit tools. Run /usr/local/bin/install_devkit.sh to globally install phploc, phpstan and phpcs.
Run /usr/local/bin/install_xdebug.sh to compile xdebug and install the module. It will then copy a default xdebug.ini config file to /config/php/xdebug.ini where you can change the settings to your needs.
- GitHub: https://github.com/roeldev/docker-php-cli
- Docker Hub: https://hub.docker.com/r/roeldev/php-cli
- PHP: https://php.net
- PHP.earth packages: https://repos.php.earth/alpine/v3.9/x86_64/
GPL-3.0+ © 2019 Roel Schut