Local PHP setup
Well-travelled path. The built-in PHP webserver is exercised by the full test suite on every change, across PHP 8.4–8.5 (the
ciworkflow).
Make sure everything is installed:
# Install required system packages, for example on Debian Linux derivatives like Ubuntu
sudo apt update
sudo apt install php8.5 php8.5-gettext php8.5-mbstring php8.5-sqlite3 php8.5-mysql php8.5-xml php8.5-gd
# PHP 8.4.1–8.5 are supported; replace 8.5 with your preferred version
# php8.5-sqlite3 ships pdo_sqlite, the driver Lamb actually connects through
# php8.5-mysql ships pdo_mysql, required because RedBeanPHP references a MySQL PDO constant at load time and fatals without it (Lamb never connects to MySQL)
# php8.5-gd converts image uploads to WebP; without it originals are stored as-is
# Install viv, the dependency installer (no apt package; there is no PHP toolchain to conflict with)
cargo binstall --git https://github.com/svandragt/vivace vivace
# or download a release binary from https://github.com/svandragt/vivace/releases
# install project packages
viv install
# Set your /login password - change `hackme` to something more secure.
# This writes the hashed password to .env.
php make-password.php hackme
# Run lamb - the dev server reads .env automatically.
viv run serve
Uploaded images are stored under src/assets/, so if you are serving Lamb through PHP-FPM or another web server user, make sure that directory is writable at runtime.