Documentation

Put your little site online.

A PHP host is enough to get started. No database or frontend build step is required.

The important part: the web root.

Upload the complete project, including src/ and autoload.php, and point the site’s document root at public/. Keep pages/, partials/, and configuration outside it. Don’t make the whole project publicly accessible.

Apache

The download includes public/.htaccess. Enable mod_rewrite and allow its FileInfo, Indexes, Options, and AuthConfig directives (or use AllowOverride All for this directory). The rules send page requests to public/index.php and leave assets alone. Directory listing and content negotiation are disabled.

Nginx

This is a starting server configuration. Replace the domain, project path, and PHP-FPM socket with your host’s values. Add your host’s TLS configuration separately.

server {
    listen 80;
    server_name example.com;
    root /srv/my-site/public;

    location /assets/ {
        location ~* \.(php[0-9]?|phtml|phar)$ { deny all; }
        try_files $uri =404;
    }

    location / {
        rewrite ^ /index.php last;
    }

    location = /index.php {
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root/index.php;
        fastcgi_pass unix:/run/php/php8.3-fpm.sock;
    }
}

HTTPS and the hostname.

Use your host’s certificate setup and redirect HTTP to HTTPS there. Choose either www or the bare domain and redirect the other at the server. Cornerstone doesn’t guess the public hostname from forwarded headers. Your server should reject unconfigured hosts.

A subdirectory instead?

Set 'base_path' => '/my-site' in config.php, mount only public/ at that path, and adapt the server’s front-controller location. Use $site->url('/about') for links and assets. Simply moving the entire project into a public subfolder is not safe.

Errors stay useful, and private.

Production errors show a short 500 page and write details to PHP’s error log. To see details locally, create config.local.php containing <?php return ['debug' => true];. That file is ignored by Git and excluded from the download. Never enable debug output on a public site.

The starter needs PHP 8.3 or newer. Serve static files from public/assets/; don’t put executable PHP there. The development server is for local use only.

Coming from the old Cornerstone?

This is a breaking rewrite. Move content from controller/Smarty pairs into plain PHP pages, replace template inheritance with includes, and keep your old URL list to check redirects. Models, migrations, Smarty, and the old application API are not included.