diff --git a/.github/workflows/debian-packages.yml b/.github/workflows/debian-packages.yml new file mode 100644 index 00000000..03acde6c --- /dev/null +++ b/.github/workflows/debian-packages.yml @@ -0,0 +1,133 @@ +# Debian packaging build lane. +# +# Builds the phpr Debian packages (php-rust/debian) on the same distro +# the packages target and publishes them as workflow artifacts: +# - phpr-cli_*_amd64.deb, phpr-server_*_amd64.deb +# - native source set (.dsc, .tar.xz) + .changes/.buildinfo +# +# This lane is deliberately SEPARATE from ci.yml (the build-and-test +# gate for main): it does not run unit tests (they live in ci.yml and +# in the local oracle gates) and it only reacts to the packaging branch. +# +# Toolchain stance (php-rust pins rustc/cargo 1.98.1): +# The lane builds on debian:trixie, whose rustc (1.85) can never +# satisfy the "rustc (>= 1.98)" Build-Depends. The PINNED toolchain +# therefore ALWAYS arrives via rustup — fetched with curl from the +# official https://sh.rustup.rs installer, never from the Debian +# archive — so the compiler follows the pin, not the suite. The +# resolved absolute toolchain pair is handed to dpkg-buildpackage +# via CARGO/RUSTC (debian/rules honours both). debian/rules strips +# ~/.cargo/bin from the build PATH, so rustup's proxy shims stay +# inert even in rustup mode. +# +# The workspace layout: the git repo ROOT contains php-rust/ (the cargo +# workspace + debian/). dpkg-buildpackage runs in php-rust/ and writes +# its artifacts (../) to the repo root. +name: debian-packages + +on: + push: + branches: [debian-packaging] + workflow_dispatch: + +permissions: + contents: read + +defaults: + run: + working-directory: php-rust + +concurrency: + group: debian-packages-${{ github.ref }} + cancel-in-progress: true + +jobs: + build-packages: + runs-on: ubuntu-latest + # The packaging target distro. trixie's rustc is older than the + # pin (1.85 vs 1.98.1), so the compiler never comes from apt here: + # the pinned toolchain is rustup-installed in a later step. + container: docker.io/library/debian:trixie + timeout-minutes: 60 + steps: + - uses: actions/checkout@v5 + + - name: Report build environment + run: | + head -2 /etc/os-release + dpkg --print-architecture + + - name: Install build dependencies + # trixie cannot resolve "rustc (>= 1.98)" (debian/control), so + # apt-get build-dep is out: install the Build-Depends EXPLICITLY, + # MINUS rustc/cargo — the pinned toolchain arrives via rustup in + # the next step. libgd3/libtidy58 come along as runtime + # dependencies of the -dev packages, so the later `dpkg -i` + # smoke step needs no extra dependency resolution. lintian ships + # here too for the gate below. + run: | + apt-get update -qq + apt-get install -y --no-install-recommends \ + dpkg-dev curl ca-certificates \ + build-essential debhelper cmake pkgconf \ + zlib1g-dev libxml2-dev libxslt1-dev libgd-dev libtidy-dev \ + libclang-dev lintian + + # Installs the pinned toolchain per the lane's policy and exposes + # the absolute paths via step outputs. rustup itself comes from + # the official installer (curl), the toolchain from the pin in + # rust-toolchain.toml. + - name: Install the pinned toolchain (rustup via curl) + id: toolchain + run: | + pinned=$(sed -n 's/^channel = "\(.*\)"/\1/p' rust-toolchain.toml) + echo "pinned: $pinned" + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \ + | sh -s -- -y --profile minimal --default-toolchain none + . "$HOME/.cargo/env" + rustup toolchain install "$pinned" --profile minimal + cargo_bin=$(rustup which --toolchain "$pinned" cargo) + rustc_bin=$(rustup which --toolchain "$pinned" rustc) + echo "cargo=$cargo_bin" >> "$GITHUB_OUTPUT" + echo "rustc=$rustc_bin" >> "$GITHUB_OUTPUT" + "$rustc_bin" --version + "$cargo_bin" --version + cat "$GITHUB_OUTPUT" | sed 's/^/resolved: /' + + - name: Build packages + env: + CARGO: ${{ steps.toolchain.outputs.cargo }} + RUSTC: ${{ steps.toolchain.outputs.rustc }} + run: | + # -d (no check-builddeps): dpkg cannot see the rustup + # toolchain, and trixie's apt rustc could never satisfy + # ">= 1.98" anyway. Every other Build-Depend was installed + # explicitly in the earlier step; the lane was validated + # end-to-end on trixie (build, lintian gate, dpkg -i, both + # packaged smoke tests green). + dpkg-buildpackage -us -uc -d + + - name: Lintian (fail on errors; warnings reported) + run: | + lintian --pedantic --fail-on error ../*.changes + + # Installed-package smoke: the same tests autopkgtest would run on + # a real testbed (debian/tests/{cli,server}), executed as root in + # this container. dpkg -i needs no dependency resolution here: the + # build-dep step already installed every runtime library. + - name: Smoke test (installed packages) + run: | + dpkg -i ../phpr-cli_*_amd64.deb ../phpr-server_*_amd64.deb + debian/tests/cli + debian/tests/server + + - name: Collect artifacts + run: | + ls -l .. + mkdir -p /tmp/out && cp ../*.deb ../*.dsc ../*.tar.xz ../*.changes ../*.buildinfo /tmp/out/ + + - uses: actions/upload-artifact@v4 + with: + name: phpr-debian-packages-amd64 + path: /tmp/out/* + if-no-files-found: error diff --git a/php-rust/debian/.gitignore b/php-rust/debian/.gitignore new file mode 100644 index 00000000..283d2532 --- /dev/null +++ b/php-rust/debian/.gitignore @@ -0,0 +1,11 @@ +# Packaging build state (dh_* staging trees and generated bookkeeping): +# regenerable on every dpkg-buildpackage run, never committed. +/.debhelper/ +/debhelper-build-stamp +/files +/*.substvars +/*.debhelper.log +/*.debhelper +/phpr-cli/ +/phpr-server/ +/tmp/ diff --git a/php-rust/debian/changelog b/php-rust/debian/changelog new file mode 100644 index 00000000..0cde7ec6 --- /dev/null +++ b/php-rust/debian/changelog @@ -0,0 +1,16 @@ +phpr (0.1.0) unstable; urgency=medium + + * Initial Debian packaging of the php-rust workspace. + * phpr-cli: ships /usr/bin/phpr; provides the Debian virtual packages + php-cli and php8.5-cli (plus php-json); conflicts with and replaces + php8.5-cli; registers /usr/bin/php via update-alternatives at + priority 85. No php.ini handling (the engine reads none), no + -v/-m/-i/-l switches yet; documented in README.Debian. + * phpr-server: ships /usr/bin/php-server (union build, cli-server + + axum-server features) and a hardened systemd service running as + www-data, configured via /etc/default/phpr-server. Makes no + php-fpm claim (no FastCGI). + * Tests: installed-package smoke tests via autopkgtest (CLI + server). + * No debian/watch: upstream develops in git without release tarballs. + + -- Francesco Tinti Sun, 22 Nov 2026 12:00:00 +0100 diff --git a/php-rust/debian/control b/php-rust/debian/control new file mode 100644 index 00000000..eb31ff99 --- /dev/null +++ b/php-rust/debian/control @@ -0,0 +1,68 @@ +Source: phpr +Section: php +Priority: optional +Maintainer: Francesco Tinti +Standards-Version: 4.7.4 +# Toolchain note (trixie): the rustc/cargo Build-Depends below pin the +# compiler for suites that ship a matching rustc via apt (the +# verification host runs Debian forky/sid). Debian trixie ships +# rustc 1.85 and can never satisfy ">= 1.98": a trixie build (the CI +# lane in .github/workflows/debian-packages.yml) installs these +# Build-Depends explicitly MINUS rustc/cargo, installs the pinned +# toolchain with rustup (https://sh.rustup.rs, fetched with curl) and +# builds with `dpkg-buildpackage -d`, passing the absolute toolchain +# pair via CARGO/RUSTC (debian/rules honours both). +Build-Depends: debhelper-compat (= 13), + rustc (>= 1.98), + cargo (>= 1.98), + cmake, + pkgconf, + zlib1g-dev, + libxml2-dev, + libxslt1-dev, + libgd-dev, + libtidy-dev, + libclang-dev +Rules-Requires-Root: no +Homepage: https://github.com/francescotinti/php-rust +Vcs-Git: https://github.com/francescotinti/php-rust.git +Vcs-Browser: https://github.com/francescotinti/php-rust + +Package: phpr-cli +Architecture: any +Depends: libgd3, libtidy58, ${shlibs:Depends}, ${misc:Depends} +Provides: php-cli, php8.5-cli, php-json, php8.5-json +Conflicts: php8.5-cli +Replaces: php8.5-cli +Description: command-line interpreter for PHP scripts (Rust reimplementation) + phpr is a from-scratch reimplementation of PHP 8.5.7 in Rust (the + php-rust project). It runs unmodified PHP scripts with the same + observable behaviour as the reference interpreter, byte-for-byte for + everything that lands in PHP strings and output streams. + . + This package installs the /usr/bin/phpr interpreter and registers it + with update-alternatives as /usr/bin/php (priority 85, the 8.5 slot), + so tooling that invokes "php" keeps working. It can coexist with the + packaged php8.4-cli / php8.6-cli; it conflicts with php8.5-cli, whose + package name it also Provides. + . + Known gaps vs the reference CLI (deliberate, documented in + /usr/share/doc/phpr-cli/README.Debian): no php.ini is read, the + -v/-m/-i/-l/-w/--ini switches are not implemented, and php8.5-* + extension modules from the archive have no effect on phpr. + +Package: phpr-server +Architecture: any +Depends: libgd3, libtidy58, ${shlibs:Depends}, ${misc:Depends} +Description: standalone PHP web server (php -S work-alike) + php-server is the web SAPI of the php-rust project: a standalone HTTP + server (a work-alike of "php -S") that serves a document root and + executes PHP requests via the phpr engine, in two modes: the + sequential cli-server mode and an Axum-based multi-worker mode + (shared FIFO queue, one fresh VM per request). + . + This is NOT FastCGI: it does not speak the FPM protocol and therefore + does not replace php8.5-fpm behind nginx/Apache fastcgi_pass. Front + it with any reverse proxy over plain HTTP instead. The service runs + as www-data and is configured through /etc/default/phpr-server + (host, port, document root, worker count). diff --git a/php-rust/debian/copyright b/php-rust/debian/copyright new file mode 100644 index 00000000..93985143 --- /dev/null +++ b/php-rust/debian/copyright @@ -0,0 +1,69 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: php-rust +Upstream-Contact: Francesco Tinti +Source: https://github.com/francescotinti/php-rust + +Files: * +Copyright: 2026 Francesco Tinti +License: PHP-3.01 + +Files: debian/* +Copyright: 2026 Francesco Tinti +License: PHP-3.01 + +License: PHP-3.01 + -------------------------------------------------------------------- + The PHP License, version 3.01 + Copyright (c) 1999 - 2024 The PHP Group. All rights reserved. + -------------------------------------------------------------------- + . + Redistribution and use in source and binary forms, with or without + modification, is permitted provided that the following conditions + are met: + . + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + . + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + . + 3. The name "PHP" must not be used to endorse or promote products + derived from this software without prior written permission. For + written permission, please contact group@php.net. + . + 4. Products derived from this software may not be called "PHP", nor + may "PHP" appear in their name, without prior written permission + from group@php.net. You may indicate that your software works in + conjunction with PHP by saying "Foo for PHP" instead of calling + it "PHP Foo" or "phpfoo" + . + 5. The PHP Group may publish revised and/or new versions of the + license from time to time. Each version will be given a + distinguishing version number. Once covered code has been + published under a particular version of the license, you may + always continue to use it under the terms of that version. You + may also choose to use such covered code under the terms of any + subsequent version of the license published by the PHP Group. No + one other than the PHP Group has the right to modify the terms + applicable to covered code created under this License. + . + 6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes PHP software, freely available from + ". + . + THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND + ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PHP + DEVELOPMENT TEAM OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. + -------------------------------------------------------------------- diff --git a/php-rust/debian/man/php-server.1 b/php-rust/debian/man/php-server.1 new file mode 100644 index 00000000..a0adf28b --- /dev/null +++ b/php-rust/debian/man/php-server.1 @@ -0,0 +1,70 @@ +.TH PHP-SERVER 1 "November 2026" "php-rust" "User Commands" +.SH NAME +php-server \- standalone PHP web server (php \-S work-alike) +.SH SYNOPSIS +.B php-server +.RI [ options ] +.RI [ ROUTER.php ] +.SH DESCRIPTION +.B php-server +is the web SAPI of the php-rust project: a standalone HTTP server that +serves a document root and executes PHP requests through the phpr +engine. It speaks plain HTTP \(em it is +.B not +a FastCGI backend and does not implement the FPM protocol, so it +cannot replace php*-fpm behind nginx/Apache +.BR fastcgi_pass . +Front it with any reverse proxy over HTTP instead. +.PP +Two modes are selected at startup: +.TP +.B cli-server (default) +Byte-faithful work-alike of the reference +.BR "php \-S" : +one thread, sequential request handling, honours a +.I ROUTER.php +router script. +.TP +.B \-\-axum +Axum front end with a pool of N OS worker threads sharing one FIFO +queue; each request runs on a fresh VM (no state leaks between +requests). Note: a router script is +.B not +honoured in this mode; single-process SIGTERM/SIGINT drains cleanly. +.SH OPTIONS +.TP +.BI \-\-host " HOST" +Listen address (default: 127.0.0.1). +.TP +.BI \-\-port " PORT" +Listen port (default: 8080). +.TP +.BI \-\-docroot " DIR" | " \-t DIR" +Document root; resolved to its canonical path and made the process +working directory (default: current directory). +.TP +.BI \-\-workers " N" +Worker count in \-\-axum mode; 0 means one worker per CPU (ignored by +the cli-server mode). +.TP +.B \-\-tier0 +Axum-only diagnostic baseline: static 200 response, no pool, no VM. +.TP +.B \-\-help +Usage summary. +.SH SYSTEMD +On Debian the +.B phpr\-server.service +unit runs this program in \-\-axum mode as the +.B www\-data +user, with settings taken from +.IR /etc/default/phpr\-server +(PHPR_HOST, PHPR_PORT, PHPR_DOCROOT, PHPR_WORKERS). Enabled by default +\(em see +.BR systemctl (1). +.SH SEE ALSO +The CLI interpreter: +.BR phpr (1). +.SH AUTHOR +php-rust by Francesco Tinti. This manual page was written for the +Debian project. diff --git a/php-rust/debian/man/phpr.1 b/php-rust/debian/man/phpr.1 new file mode 100644 index 00000000..b8ef75ba --- /dev/null +++ b/php-rust/debian/man/phpr.1 @@ -0,0 +1,110 @@ +.TH PHPR 1 "November 2026" "php-rust" "User Commands" +.SH NAME +phpr \- command-line interpreter for PHP scripts (Rust reimplementation) +.SH SYNOPSIS +.B phpr +.RB [ \-d +.IR key = value ]... +.RB [ \-n ] +.RB [ \-f ] +.IR script.php +.RI [ args ...] +.br +.B phpr \-r +.I code +.br +.B phpr \-S +.IR addr : port +.RB [ \-t +.IR docroot ] +.RI [ router.php ] +.SH DESCRIPTION +.B phpr +is the CLI SAPI of the php-rust project, a behaviour-compatible +reimplementation of PHP 8.5.7 written in Rust. It executes unmodified +PHP scripts with the same observable behaviour as the reference +interpreter, byte-for-byte for everything that lands in PHP strings +and output streams. Scripts read from stdin and +.B #! +shebang lines are supported, like the reference CLI. +.PP +On Debian, +.BR update-alternatives (1) +exposes +.B phpr +as +.RI /usr/bin/php +(priority 85), so tools invoking +.B php +keep working. Use +.B "update-alternatives --config php" +to select among installed interpreters (php8.4-cli, php8.6-cli, ...). +.SH OPTIONS +.TP +.BI \-d " key=value" +Sets the INI entry +.I key +to +.I value +for this process (no +.B = +means an empty value). Only entries the engine implements are +honoured. +.TP +.B \-n +Accepted for compatibility; the reference CLI skips php.ini with it. +.B phpr +never loads a php.ini at all \(em this flag is a no-op. +.TP +.BI \-f " script" +Interpret +.IR script . +.TP +.BI \-r " code" +Run +.I code +inline (implicit leading +.BR " +# libtidy58 installed) this is automatic. SHLIB_AUX_DIR (optional, +# environment-supplied) covers hosts that stage the runtime libraries +# outside the dpkg database: the SONAME -> package mapping itself is +# declared in debian/shlibs.local either way. +ifneq (,$(SHLIB_AUX_DIR)) +override_dh_shlibdeps: + dh_shlibdeps -l$(SHLIB_AUX_DIR) +endif diff --git a/php-rust/debian/shlibs.local b/php-rust/debian/shlibs.local new file mode 100644 index 00000000..5f44ab22 --- /dev/null +++ b/php-rust/debian/shlibs.local @@ -0,0 +1,7 @@ +# Local shlibs knowledge for dpkg-shlibdeps: phpr links the system +# libtidy (byte-parity FFI, like libgd/libxml2/libxslt/zlib). On build +# hosts where libtidy58 is not installed, dpkg-shlibdeps cannot map +# libtidy.so.58 to its package; the mapping is stable, so declare it +# locally. The runtime dependency is also stated explicitly in +# debian/control (libgd3, libtidy58). +libtidy 58 libtidy58 diff --git a/php-rust/debian/source/format b/php-rust/debian/source/format new file mode 100644 index 00000000..89ae9db8 --- /dev/null +++ b/php-rust/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/php-rust/debian/source/lintian-overrides b/php-rust/debian/source/lintian-overrides new file mode 100644 index 00000000..9fc5212a --- /dev/null +++ b/php-rust/debian/source/lintian-overrides @@ -0,0 +1,9 @@ +# lintian (from trixie on) raises license-problem-php-license as an +# ERROR for any PHP-licensed software that is not the PHP interpreter +# itself; sid's lintian did not emit it. The PHP License 3.01 is the +# deliberate, documented licensing decision of this project (AGENTS.md, +# "Licenza"; debian/copyright keeps the canonical text), so the tag is +# overridden at source level: the --fail-on error gate of the CI lane +# (.github/workflows/debian-packages.yml) stays meaningful on every +# suite without special-casing the build distro. +license-problem-php-license diff --git a/php-rust/debian/source/options b/php-rust/debian/source/options new file mode 100644 index 00000000..5d4f1bd5 --- /dev/null +++ b/php-rust/debian/source/options @@ -0,0 +1,13 @@ +# Native tarball hygiene: the git tree carries per-session measurement +# harnesses (wp*-harness), session diaries, the vet catalogue and local +# tool configs that are development-history material, not needed to +# build or run phpr. tar-ignore patterns go straight to tar(1) --exclude +# (Files-Excluded in debian/copyright has no effect on 3.0 (native)). +tar-ignore = "wp*-harness*" +tar-ignore = "sessions*" +tar-ignore = "gaps*" +tar-ignore = ".claude*" +tar-ignore = ".cargo*" +tar-ignore = "._*" +tar-ignore = ".DS_Store" +tar-ignore = "phpr-target-bundle.sh" diff --git a/php-rust/debian/tests/cli b/php-rust/debian/tests/cli new file mode 100755 index 00000000..0e33d254 --- /dev/null +++ b/php-rust/debian/tests/cli @@ -0,0 +1,40 @@ +#!/bin/sh +# Installed-package smoke test for phpr-cli: arithmetic, argv, the +# update-alternatives registration and a json round-trip (the package +# claims Provides: php-json). +set -e + +out=$(/usr/bin/phpr -r 'echo 6*7;') +if [ "$out" != "42" ]; then + echo "FAIL: arithmetic, got '$out'" >&2 + exit 1 +fi + +out=$(/usr/bin/phpr -r 'echo json_encode(json_decode("[1,\"two\"]"));') +if [ "$out" != '[1,"two"]' ]; then + echo "FAIL: json round-trip, got '$out'" >&2 + exit 1 +fi + +# The package must hold the /usr/bin/php alternative at priority 85. +# (Non-fatal: if a higher-priority PHP is installed, /usr/bin/php can +# legitimately point elsewhere; the registration itself must exist.) +if ! update-alternatives --query php 2>/dev/null | grep -q '^Value: /usr/bin/phpr$'; then + echo "note: /usr/bin/php not currently pointing at phpr (higher-priority PHP installed?)" >&2 +fi +if ! update-alternatives --query php 2>/dev/null | grep -q '^Alternative: /usr/bin/phpr$'; then + echo "FAIL: phpr not registered as a php alternative" >&2 + exit 1 +fi + +# A script with argv passthrough, the common cron/CLI shape. +tmp=$(mktemp -d) +trap 'rm -rf "$tmp"' EXIT +printf ' "$tmp/args.php" +out=$(/usr/bin/phpr "$tmp/args.php" foo bar) +if [ "$out" != "foobar" ]; then + echo "FAIL: script argv, got '$out'" >&2 + exit 1 +fi + +echo "cli smoke OK: 42, json round-trip, alternatives, argv" diff --git a/php-rust/debian/tests/control b/php-rust/debian/tests/control new file mode 100644 index 00000000..d4068fb8 --- /dev/null +++ b/php-rust/debian/tests/control @@ -0,0 +1,7 @@ +Tests: cli +Restrictions: allow-stderr +Depends: @, phpr-cli + +Tests: server +Restrictions: allow-stderr +Depends: @, phpr-server, curl diff --git a/php-rust/debian/tests/server b/php-rust/debian/tests/server new file mode 100755 index 00000000..26a6b55d --- /dev/null +++ b/php-rust/debian/tests/server @@ -0,0 +1,42 @@ +#!/bin/sh +# Installed-package smoke test for phpr-server: run the packaged +# binary in --axum mode against a throwaway document root and fetch +# a rendered PHP page over HTTP. +set -e + +docroot=$(mktemp -d) +trap 'rm -rf "$docroot"; [ -n "${srv:-}" ] && kill "$srv" 2>/dev/null || true' EXIT +printf ' "$docroot/index.php" + +/usr/bin/php-server --axum --host 127.0.0.1 --port 18099 --docroot "$docroot" & +srv=$! + +# Wait for the listener (the server binds before logging readiness). +i=0 +while ! curl -sf -o /dev/null http://127.0.0.1:18099/ 2>/dev/null; do + i=$((i+1)) + if [ "$i" -gt 50 ]; then + echo "FAIL: server never came up" >&2 + exit 1 + fi + sleep 0.1 +done + +out=$(curl -sf http://127.0.0.1:18099/) +if [ "$out" != "hello 42" ]; then + echo "FAIL: rendered page, got '$out'" >&2 + exit 1 +fi + +# Static file from the docroot walk. +printf 'static' > "$docroot/data.txt" +out=$(curl -sf http://127.0.0.1:18099/data.txt) +if [ "$out" != "static" ]; then + echo "FAIL: static file, got '$out'" >&2 + exit 1 +fi + +kill "$srv" +wait "$srv" 2>/dev/null || true +srv= +echo "server smoke OK: php page + static file over HTTP"