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.
PHP 8.1 Legacy applications
PHP 8.2 Current LTS-style choice
PHP 8.3 Recommended defaultMatch the version your framework declares. Running a modern framework on an older runtime is the most common cause of cryptic
500errors after a migration.
How overrides work
Three layers combine at runtime:
| Layer | Owner | Example |
|---|---|---|
| Server profile | Administrator | memory_limit = 128M |
| Site overrides | Customer | memory_limit = 256M |
| Application | ini_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
| Directive | Range | Default | Notes |
|---|---|---|---|
memory_limit | 64M – 1G | 128M | Accepts M/G suffixes |
max_execution_time | 30 – 300 | 60 | Seconds; 0 not allowed |
max_input_time | 30 – 300, -1 | 60 | -1 means unlimited |
upload_max_filesize | 2M – 512M | 64M | Must be ≤ post_max_size |
post_max_size | 2M – 512M | 64M | Must be ≥ upload size |
max_input_vars | 1000 – 10000 | 1000 | Raise for large forms |
display_errors | On / Off | Off | Keep Off in production |
error_reporting | numeric or E_* | E_ALL | Accepts E_ALL & ~E_DEPRECATED |
date.timezone | IANA name | UTC | e.g. Asia/Shanghai |
session.gc_maxlifetime | 1440 – 86400 | 1440 | Seconds |
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
- Open the site → PHP.
- Toggle Override next to a directive.
- Enter a value and save.
- 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
GET /api/user/sites/42/php/settings
Authorization: Bearer <access-token>{
"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:
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:
{ "overrides": { "memory_limit": null } }Reset every override:
POST /api/user/sites/42/php/settings/resetList extensions available to the selected version:
GET /api/user/sites/42/php/extensionsOperational notes
- Overrides are written to a per-site
php.inifragment, not to the global file. max_execution_timedoes not include time spent in blocking system calls; use a queue worker for long jobs.upload_max_filesizeandpost_max_sizemust move together. Setpost_max_sizeslightly larger.- After changing
error_reporting, reproduce the issue and check the site error log;display_errorsonly affects the response body. - FPM pools are reloaded gracefully. In-flight requests finish on the old configuration.
Related
- Websites for vhosts and deployment
- User API for the full endpoint reference
- Troubleshooting when a change causes a
502