Skip to content
WasFor
Back to home
Documentation/User panel

PHP runtime

Every site runs on a PHP version you choose. On top of the version, WasFor lets you override individual php.ini directives per site without touching the server-wide profile.

Choose a version

Websites → site → Settings → PHP version lists the versions installed on the node. Changing it rewrites the vhost's FPM socket and reloads only that pool — other sites keep serving.

text
PHP 8.1   Legacy applications
PHP 8.2   Current LTS-style choice
PHP 8.3   Recommended default

Match the version your framework declares. Running a modern framework on an older runtime is the most common cause of cryptic 500 errors after a migration.

How overrides work

Three layers combine at runtime:

LayerOwnerExample
Server profileAdministratormemory_limit = 128M
Site overridesCustomermemory_limit = 256M
Applicationini_set()Request-scoped tuning

A directive is inherited until the site sets it. An override value of null or an omitted key means "keep inheriting". This makes it safe to change the server default later without surprising every site.

Supported directives

DirectiveRangeDefaultNotes
memory_limit64M – 1G128MAccepts M/G suffixes
max_execution_time30 – 30060Seconds; 0 not allowed
max_input_time30 – 300, -160-1 means unlimited
upload_max_filesize2M – 512M64MMust be ≤ post_max_size
post_max_size2M – 512M64MMust be ≥ upload size
max_input_vars1000 – 100001000Raise for large forms
display_errorsOn / OffOffKeep Off in production
error_reportingnumeric or E_*E_ALLAccepts E_ALL & ~E_DEPRECATED
date.timezoneIANA nameUTCe.g. Asia/Shanghai
session.gc_maxlifetime1440 – 864001440Seconds

Validation happens before anything is written. An out-of-range value is rejected with a field-level error; it is never silently clamped.

Manage overrides in the panel

  1. Open the site → PHP.
  2. Toggle Override next to a directive.
  3. Enter a value and save.
  4. Confirm the change in the Effective column.

The panel highlights warnings such as post_max_size being smaller than upload_max_filesize, which would silently truncate uploads.

Manage overrides through the API

http
GET /api/user/sites/42/php/settings
Authorization: Bearer <access-token>
json
{
  "ok": true,
  "data": {
    "php_version": "8.3",
    "runtime": "fpm",
    "supported": ["memory_limit", "max_execution_time", "upload_max_filesize"],
    "inherited": { "memory_limit": "128M", "max_execution_time": "60" },
    "overrides": { "memory_limit": "256M" },
    "effective": { "memory_limit": "256M", "max_execution_time": "60" },
    "limits": { "memory_limit": { "min": "64M", "max": "1G" } },
    "warnings": []
  }
}

Update overrides with a partial object; keys you omit keep their current state:

http
PUT /api/user/sites/42/php/settings
Content-Type: application/json

{ "overrides": { "memory_limit": "256M", "display_errors": "Off" } }

To stop overriding a directive, send null:

json
{ "overrides": { "memory_limit": null } }

Reset every override:

http
POST /api/user/sites/42/php/settings/reset

List extensions available to the selected version:

http
GET /api/user/sites/42/php/extensions

Operational notes

  • Overrides are written to a per-site php.ini fragment, not to the global file.
  • max_execution_time does not include time spent in blocking system calls; use a queue worker for long jobs.
  • upload_max_filesize and post_max_size must move together. Set post_max_size slightly larger.
  • After changing error_reporting, reproduce the issue and check the site error log; display_errors only affects the response body.
  • FPM pools are reloaded gracefully. In-flight requests finish on the old configuration.
Last updated: 2026-12-01