Skip to content

billzhong/docker-php-builtin-server

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-php-builtin-server

docker container providing php builtin server with mysql, pdo and xdebug modules.

building

Built image: docker build -t php-builtin-server:latest https://github.com/pawelkorus/docker-php-builtin-server.git

You may use --build-arg PHP_IMAGE=<version> to specify base php image version.

running

If you want to run php builtin server that serves content in current working directory then excute: docker run --rm -v "$PWD":/root-dir -d -p 127.0.0.1:8000:8000 php-builtin-server:latest

Use --user option to setup user/group id for php builtin server process docker run --rm -v "$PWD":/root-dir -d -p 127.0.0.1:8000:8000 --user $(id -u):$(id -g) php-builtin-server:latest

xdebug

PHP in this container is preconfigured with XDebug. This configuration enables "remote connect back mode" (see https://xdebug.org/docs/remote). In this mode XDebug detects 'debugger' ip address from incoming HTTP request headers. It also assumes that 'debugger' is listening on port 9000. With this setup you have few options that allow you to debug your application.

You can use default docker bridge network. In this case you have to use docker bridge host ip address when making HTTP request to php container.

Another options is to use docker host network driver by executing docker run command with additional --net host parameter. In this case container and host share the same network and 'debugger' port (9000) is visible from php container. You can use any ip address assigned to host when making HTTP request to php container.

About

Docker image that runs php builtin server

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dockerfile 94.6%
  • Shell 5.4%