# PHP hosting in 2026: how to deploy a PHP app or site

> A PHP project is recognised from index.php or composer.json, its dependencies are installed, and it is served by FrankenPHP on the port Livops assigns. A plain folder of PHP files needs no configuration at all.

Source: https://livops.dev/en/hosting/php-hosting

By Livops team, the people who build and run Livops. Updated 28 November 2026.

Livops finds a PHP project in two ways. A folder with `index.php` or `composer.json` is a PHP project. A folder with a `package.json` as well is a PHP project with a front end, for example a Laravel app whose CSS is built with Node. Livops installs the dependencies, runs the build if there is one, and starts the server.

## What runs

- install: `composer install --no-dev --optimize-autoloader --no-interaction`, when there is a `composer.json`
- build: `npm run build`, when `package.json` has a build script
- start: FrankenPHP serves the project folder on the port that `PORT` gives it

The folder is served from the top of the project, as it was written. A plain PHP project with an `index.php` and some pages works with no configuration.

## Defaults the server sets

Some settings are set for you unless you have set them yourself:

- `SESSION_DRIVER=cookie`, so sessions need no database
- `CACHE_STORE=file`
- `LOG_CHANNEL=stderr`, so the log appears in the logs tab

A variable you set in the cabinet overrides each of these.

## Laravel

Laravel has its own rules, such as migrations and the queue worker, and they are covered in [Laravel hosting](https://livops.dev/en/hosting/laravel-hosting). Read that guide before you deploy a Laravel app.

## Environment variables

Put secrets and settings in the Variables section of the cabinet. A change takes effect after a restart, and a variable that the build reads needs a new deploy.

## Common mistakes

- **Starting a PHP development server.** `php -S` and similar commands are for your laptop. Livops runs FrankenPHP.
- **A hard-coded port.** Use `PORT` from the environment.
- **Secrets in the repository.** Put database passwords and API keys in the Variables section, not in a file you commit.
- **Expecting a file the app wrote to survive a deploy.** A new deploy starts again from your code, so files written while the app runs are not part of it. Keep uploads in a bucket or a database.

## Questions

**Is a PHP site free on Livops?**

A PHP app is a server process, so it is a web app and is paid by the memory it uses. Livops does not serve PHP as static files, because the PHP code must run on each request.

**Where do the sessions and the cache go?**

By default sessions are stored in cookies and the cache in files, and the log goes to stderr, where the logs tab reads it. Each of these is a default only: a value you set in the variables wins.

**Does Livops run composer install?**

Yes, when the project has a composer.json. It runs composer install with --no-dev and an optimised autoloader. If the project also has a package.json with a build script, that script runs after it.

## Sources

1. [FrankenPHP — Documentation](https://frankenphp.dev/docs/). Checked 28 November 2026.
2. [Composer — Documentation](https://getcomposer.org/doc/). Checked 28 November 2026.
