Project PHP

A server can run several PHP versions side by side. A project's PHP section picks which of them the project runs on, and holds PHP values that apply to this project only: one set for web requests (PHP-FPM) and one for the command line.

Open the project and pick PHP under Configure in the menu beside the page. The section is there for PHP projects (Laravel, Symfony, Statamic, WordPress and plain PHP) and for roles with project:update — Owner, Admin, Manager and Developer.

Installing, removing and updating PHP versions, and the values every project on the server starts from, live on the server: see PHP Configuration.

The section has three boxes. Changes in any of them are kept until you press Save in the Unsaved changes bar at the foot of the page.

Version #

PHP version lists the versions installed on the project’s server. The server’s default version is marked (server default). A new project is pinned to the server default when it is created; changing the server default later does not move it.

If the version you need is missing, Install another version on the server opens the server’s PHP section. The link shows for roles with server:update.

What happens when you change the version #

Changing the version is a deployment. When you pick a different version, Depfloy first reads the live release’s composer.json and composer.lock:

  • A require.php or config.platform.php constraint the new version does not satisfy blocks the change, and the section says why (“PHP 8.4 cannot run this project”).
  • An ext-* requirement the new version does not have installed, or swoole missing for an Octane project, is shown as a warning. You can still save.

On Save, Depfloy deploys the commit that is live now, built with the new version — the latest commit on the branch if the project has never been deployed. No unreleased commit ships with a version change. The site keeps running on the old version until the new release is live, and a failed deployment leaves the old version serving. While the deployment runs, the section shows Deploying with PHP … with a link to follow it, and the version cannot be changed again until it finishes.

Changing the version needs deployment:create as well as project:update. A role without it sees “Changing the version deploys the project, which your role cannot do.”

Rolling back to a release that was built on another PHP version switches the project back to that version.

When a deploy moves a project to another version, each Laravel plugin (Horizon, Reverb, Octane, Nightwatch) is restarted once, from the new release.

One-click apps. WordPress and phpMyAdmin projects have no deployment. Their version is switched in place, and put back if the server refuses it. See One-Click Install.

Web requests (PHP-FPM) #

Values here apply to the project’s web requests:

FieldPHP setting
Memory limitmemory_limit
Max execution time (s)max_execution_time
Max input time (s)max_input_time
Post max sizepost_max_size
Upload max file sizeupload_max_filesize
Max input varsmax_input_vars
Max PHP workerspm.max_children

An empty field uses the server’s value for this version; the placeholder shows it, for example 128M (server). Setting any of these fields gives the project its own PHP-FPM pool instead of the server’s shared one.

Command line #

Command line (artisan, composer, cron, workers) takes memory_limit and max_execution_time for the PHP CLI. An empty field uses the server’s CLI value; an empty max execution time means no limit, as in PHP’s own CLI default.

The project’s version and these values apply wherever Depfloy runs PHP for the project: deploy commands, Commands, Schedulers, Background Jobs, Laravel plugins, and composer.

When settings take effect #

Saving PHP values does not deploy. Depfloy applies them on the server and reports the result. If the server refuses them, the previous values stay in use and a message says so.

From the API and MCP #

The same settings are available outside the console:

  • GET /api/v1/projects/{id}/php — current version, installed versions, server values and the project’s overrides
  • PUT /api/v1/projects/{id}/php — PHP values, no deployment
  • POST /api/v1/projects/{id}/php/version — change the version (starts the deployment)
  • MCP update_project with php_version and php_settings

Creating a project through the console, POST /api/v1/projects or MCP create_project accepts an optional php_version from the versions installed on the server. See Projects API and MCP.