PHP
Deploy a plain PHP app on DockHosting — no framework required.
For PHP without a framework (or a framework DockHosting doesn't detect automatically), the build looks for composer.json and installs dependencies with Composer if one is present, then serves your app with PHP-FPM behind a web server.
Building a Laravel app specifically? See the dedicated Laravel guide — the same underlying build, with Laravel-specific notes (APP_KEY, migrations, queues).
Requirements
- A
composer.jsonat the repository root if you have dependencies — a project with no Composer dependencies at all works too, DockHosting just skips that step - An entry point the web server can find — typically
public/index.phporindex.phpat the root, depending on how your project is laid out
Environment variables
Read with getenv('VARIABLE_NAME') or $_ENV['VARIABLE_NAME'], depending on your php.ini configuration. Set them in your project's environment variables — see Environment variables.
Databases
MySQL, MariaDB, and Postgres all work with PHP's standard PDO extension. The connection string DockHosting injects when you attach a database can be parsed into PDO's DSN format, or used directly if your code already expects a full connection URL.
Extensions
If your code needs a PHP extension beyond the defaults (gd, imagick, redis, etc.), declare it explicitly — a build that assumes an extension is present without requiring it fails at runtime, not at build time, which is a much harder failure to diagnose. See the note on missing extensions in the Laravel guide, which applies to plain PHP the same way.