Skip to content

Latest commit

 

History

History
41 lines (25 loc) · 1.66 KB

File metadata and controls

41 lines (25 loc) · 1.66 KB

PHP (php)

Develop PHP based applications. Includes needed tools, extensions, and dependencies.

Options

Options Id Description Type Default Value
imageVariant PHP version (use -trixie, -bookworm, -bullseye variants on local arm64/Apple Silicon): string 8.4-trixie

This template references an image that was pre-built to automatically include needed devcontainer.json metadata.

  • Image: mcr.microsoft.com/devcontainers/php (source)
  • Applies devcontainer.json contents from image: Yes (source)

Starting / stopping Apache

This dev container includes Apache in addition to the PHP CLI. While you can use PHP's built in CLI (e.g. php -S 0.0.0.0:8080), you can start Apache by running:

apache2ctl start

Apache will be available on port 8080.

If you want to wire in something directly from your source code into the www folder, you can add a symlink as follows to postCreateCommand:

"postCreateCommand": "sudo chmod a+x \"$(pwd)\" && sudo rm -rf /var/www/html && sudo ln -s \"$(pwd)\" /var/www/html"

...or execute this from a terminal window once the container is up:

sudo chmod a+x "$(pwd)" && sudo rm -rf /var/www/html && sudo ln -s "$(pwd)" /var/www/html

Note: This file was auto-generated from the devcontainer-template.json. Add additional notes to a NOTES.md.