This is enough to run the site and test PDF export:
sudo apt update
sudo apt install php-cli php-xml php-mbstring php-gd
dom extension that Dompdf requires (a missing dom extension caused the earlier error)php -v
php -m | grep -i -E "dom|mbstring|gd"
Run these in the project folder:
cd ~/Webdesign/testbed/CheapIndex
php -S localhost:8000
Open http://localhost:8000 in your browser. Changes to index.php and index.md show up as soon as you refresh the page. You only need to restart the server if you install or change PHP extensions.
The built-in server does not automatically route URLs like /contact or /about to index.php, so they return a 404 error. If you want to test the $url_routes feature locally, create a file called router.php in the project folder:
<?php
// Let existing files through (css, images, helpers/pdf.php)
$path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
if ($path !== '/' && file_exists(__DIR__ . $path)) {
return false;
}
require __DIR__ . '/index.php';
Start the server like this:
php -S localhost:8000 router.php
On a production server (Apache or Nginx) this is handled with .htaccess or server configuration, so router.php is only needed for local testing.