Docs menu
PHP
Deploy PHP apps with Composer on Primcloud, served by Apache with PHP-FPM by default or nginx via a Procfile switch.
On this page
Primcloud deploys PHP apps managed by Composer. Detection triggers when Primcloud finds a composer.json at the root of your repo. Dependencies declared in require are installed with composer install, and the app is served by Apache 2.4 with PHP-FPM by default, or by nginx with PHP-FPM if you ask for it in a Procfile. Both web servers are fully supported; pick whichever your app expects.
The PHP runtime version is resolved from the require."php" constraint in your composer.json (or the platform requirements in composer.lock when it's present, which win). If no PHP requirement is set anywhere, you get the latest supported major.
With no Procfile, Primcloud starts a single web process running heroku-php-apache2: Apache with PHP-FPM serving from the repo root. To change the document root, switch to nginx, or add worker and release processes, drop a Procfile in the repo root.
What's in this section#
- Getting started with PHP: deploy a minimal Slim app end-to-end.
- PHP on Primcloud: detection, Composer install, web server selection, and process type behavior.
- Runtime versions: supported PHP majors, pinning via
composer.json, and upgrade path. - Package managers: Composer install behavior, private repositories, and lockfile requirements.
- Customizing the build: the
compileComposer script, custom nginx/Apache config, PHP extensions, and Debian packages viaproject.toml. - Troubleshooting PHP: common build and runtime errors with fixes.
- Deploying Laravel:
Procfileshape, env vars, migrations, and the Laravel-specific gotchas that come up on Primcloud.