Skip to main content

PHP Basic Webserver

PHP Basic Webserver logo
PHP Basic Webserverv1.0.0

PHP web server using built-in server with health endpoint and Docker support

A minimal PHP web server using PHP's built-in server with a health check endpoint. Includes Docker containerization, Kubernetes deployment manifests, and GitHub Actions CI/CD workflow.

Tools: dev-php-laravel
Install:dev-template php-basic-webserver
Maintainers: terchristerchris
GETTING STARTED

Prerequisites

Files

ENVIRONMENT

What gets set up

When you install this template, the following are configured for you:

In your devcontainer

Run the PHP server

php -S 0.0.0.0:3000 -t public

PHP's built-in server runs on port 3000. VS Code auto-forwards the port.

ARCHITECTURE

Architecture

These diagrams are auto-generated from the template's metadata. Click any diagram to enlarge.

Deployment

Template README

The PHP Basic Webserver template is a simple hello world app using PHP with Apache that displays "Hello world" on a web page. The purpose of this simple app is to verify that the development environment is set up and ready. See more documentation at http://localhost:3000/docs/templates/basic-web-server/php-basic-webserver

HTTP API

PathMethodResponse
/GETtext/plain: greeting, template id php-basic-webserver, time and date

There is no separate health route in the default code.

Entry point and port

  • File: app/index.php
  • Run: php -S 0.0.0.0:3000 app/index.php (built-in server; no auto-reload — restart after edits)

Changing the app

  • Add routing by checking $_SERVER['REQUEST_URI'] or introduce a small router, or switch to a framework while keeping app/ as the docroot.