templates/php-app
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-28 15:28:02 +02:00
..
public Initial release (1.0.0) 2026-11-28 15:28:02 +02:00
.env.example Initial release (1.0.0) 2026-11-28 15:28:02 +02:00
Caddyfile Initial release (1.0.0) 2026-11-28 15:28:02 +02:00
docker-compose.yml Initial release (1.0.0) 2026-11-28 15:28:02 +02:00
README-pt.md Initial release (1.0.0) 2026-11-28 15:28:02 +02:00
README.md Initial release (1.0.0) 2026-11-28 15:28:02 +02:00

PHP site

Português

A PHP site with no dependencies: a home page, a contact form that checks its fields, and /health. PHP 8.3 runs in PHP-FPM, behind Caddy with HTTPS. The code also works on PHP 7.4.

Files

  • public/index.php: the site. Every file in public/ is served; keep everything else outside it.
  • Caddyfile: HTTPS for DOMAIN, PHP through php_fastcgi.
  • docker-compose.yml: PHP-FPM and Caddy.
  • .env.example: copy it to .env and set DOMAIN, SITE_NAME and TZ.

The form only checks the fields. To receive the messages, send them from index.php through your email service, for example the E-mail Center API of Interweb Angola (https://docs.interweb.ao/email-center/), with the API key in .env.

Try it on your computer

php -S localhost:8000 -t public public/index.php

Or with Docker: cp .env.example .env, set DOMAIN=localhost and run docker compose up -d.

Publish on your VPS

From the templates folder: sh deploy.sh php-app root@<server ip>. See the main README for the IP and the DNS records.