PHP Basic Webserver
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.
terchrisPrerequisites
Files
Files (9)
├── .dockerignore ├── .gitignore ├── Dockerfile ├── README-php-basic-webserver.md ├── template-info.yaml ├── .github/ │ └── workflows/ │ └── urbalurba-build-and-push.yaml ├── app/ │ └── index.php └── manifests/ ├── deployment.yaml └── kustomization.yaml
Related templates
①What gets set up
When you install this template, the following are configured for you:
- Installs PHP 8.4, Composer, Laravel installer, and sets up Laravel development environment
②Run the PHP server
php -S 0.0.0.0:3000 -t publicPHP's built-in server runs on port 3000. VS Code auto-forwards the port.
Architecture
These diagrams are auto-generated from the template's metadata. Click any diagram to enlarge.
Deployment
Components
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
| Path | Method | Response |
|---|---|---|
/ | GET | text/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 keepingapp/as the docroot.