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.
By Livops team, the people who build and run LivopsUpdated
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 acomposer.json - build:
npm run build, whenpackage.jsonhas a build script - start: FrankenPHP serves the project folder on the port that
PORTgives 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 databaseCACHE_STORE=fileLOG_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. 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 -Sand similar commands are for your laptop. Livops runs FrankenPHP. - A hard-coded port. Use
PORTfrom 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
- FrankenPHP — Documentation (frankenphp.dev). Checked .
- Composer — Documentation (getcomposer.org). Checked .
Put your project online today
Connect GitHub or drop a folder. No card is asked for.
Deploy your PHP appRelated
- Laravel hosting with queues and the scheduler: the options comparedA Laravel app in production is three processes: the web server, a queue worker that is restarted on every deploy, and the scheduler run every minute. On Livops the web app runs from a push with APP_KEY generated and migrations run, for 39 credits a month (39,000 so'm), and the worker and the scheduler are services of their own at 19 credits each. Here is how Render, Railway, Fly.io and a VPS compare.
- 502 Bad Gateway after deploying: what it means and how to fix itThe proxy in front of your app reached for it and got no valid answer: nothing was listening on the port it tried, or the process closed the connection mid-request. After a deploy that is almost always one of five things: the app listens on the wrong port or on 127.0.0.1, it crashed on start, it was still starting, it ran out of memory, or the proxy points at the wrong port. The app's own log says which.
- App not listening on $PORT: why the health check failed after deployThe platform started your app, tried the port it gave it, and nothing answered in time. Almost always the app listens on its own fixed port instead of the PORT variable, listens on localhost (127.0.0.1) instead of 0.0.0.0, or crashed or was still starting when the check gave up. Listen on 0.0.0.0 and the port in PORT, and it passes.
- Docker hosting: how to deploy a Docker container or a DockerfileTo host a container you need a host that builds or pulls the image, starts its CMD, sends traffic to the port it listens on and stops it with SIGTERM. On Livops a Dockerfile at the root of the repository is built on Livops's servers and runs for 39 credits a month (39,000 so'm); a public image from Docker Hub, GHCR or Quay runs without a build. Here is what a container needs, and how a VPS, Render, Railway, Fly.io, DigitalOcean and Heroku compare.
- Ruby on Rails hosting in 2026: how to deploy a Rails app, and whereA Rails app in production needs its secret_key_base, precompiled assets, migrations before each start, Puma on the port it is given, and a real database. On Livops a repository with a Gemfile and config/application.rb gets all of that from a push, for 39 credits a month (39,000 so'm). Here is how Heroku, Render, Fly.io, Railway and a VPS with Kamal compare.
- Composer: Your requirements could not be resolved to an installable set of packages — how to fix itYour requirements could not be resolved to an installable set of packages means Composer found no set of versions that fits composer.json and the machine it runs on. The Problem lines under it name the cause: Root composer.json requires php ^8.3 but your php version (8.2.x) does not satisfy that requirement is a PHP version mismatch, it is missing from your system is a missing extension, and the rest are conflicting constraints. Match PHP versions, set config.platform.php, install the extension, or find the blocker with composer why-not.