$ doas pkg_add php
$ doas rcctl enable php74_fpm
$ doas rcctl start php74_fpm
server "example.com" {
        listen on * port 8080
        location "*.php" {
                fastcgi socket "/run/php-fpm.sock"
        }
}

To check for PHP configuration errors:

# less /var/www/logs/access.log
# less /var/www/logs/error.log