shumkov / dhp
Docker PHP interpreter
Installs: 15
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Language:Shell
pkg:composer/shumkov/dhp
This package is not auto-updated.
Last update: 2025-10-31 23:47:12 UTC
README
DHP is a wrapper around a PHP docker container. It provides transparent using containerized PHP as you use usual local PHP interpreter.
P.S. i shit bash.
Installation
-
Install composer.
-
Add this line to your
~/.zshrcor~/.bashrc:export PATH=~/.composer/vendor/bin:$PATH
-
Install DHP:
composer global require shumkov/dhp:*
Upgrade
Run composer global update shumkov/dhp
Using
You can use dhp command as usual PHP interpreter.
Example: dhp script.php or dhp -i.
xDebug is disabled by default. It will enable when you will start debug.
For starting debugger pass XDEBUG_CONFIG env variable.
Example: XDEBUG_CONFIG="idekey=PHPSTORM" dhp script.php
Configuration
Available options:
DHP_DOCKER_IMAGE- Docker PHP image name. Default:docker2o.itim.vn/library/php:7.0DHP_EXPORT_ENV- List of env variables to pass to phpDHP_DOCKER_NET- Use existing docker network
You have three ways to set options:
- As env variables in your shell. Example:
export DHP_EXPORT_ENV="APP_ENV" - Pass options before command. Example:
DHP_EXPORT_ENV="APP_ENV" dhp script.php - Create
.envfile with options in your project root path (recommended)
Author
Ivan Shumkov ivan@shumkov.ru