templates/php-app/README.md
2026-11-28 15:28:02 +02:00

1.1 KiB

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.