# Deploy PHP

Any PHP app runs as a container on the PHP runtime - the machinery behind the [Laravel](/platform/frameworks/laravel), [Symfony](/platform/frameworks/symfony), and [WordPress](/platform/frameworks/wordpress) guides, available to plain PHP too. Detection reads your `composer.json` (or plain `.php` entry points); the default port is `8080`.

## How it runs

The [generated image](/platform/deployments/builds#dockerfiles-generated-or-your-own) serves your app on the routed [port](/create/build-settings#port) with a production PHP setup - Composer dependencies installed during the build. A repo with its own Dockerfile (FrankenPHP, custom FPM tuning) is used as written.

## Configuration and database

Read [environment variables](/platform/environment-variables#build-time-and-runtime) with `getenv()`/`$_ENV` at request time - they are present for every request, per environment. Database credentials come from the [Credentials tab](/platform/databases/connect) as a URL or discrete values, whichever your app expects.

## The stateless rule

Instances come and go with [scaling](/create/scaling) - local files don't survive. Sessions belong in the database or cookies, uploads on object storage via your app's storage layer, caches somewhere shared. Frameworks handle this with a config switch; plain PHP needs it kept in mind.

## Related

- [Laravel](/platform/frameworks/laravel): The full-framework guide.
- [Symfony](/platform/frameworks/symfony): The other full-framework guide.
- [WordPress](/platform/frameworks/wordpress): The CMS path with one-click database wiring.
