PHP versions
Each site runs on its own PHP version. Sites on the same version share one PHP container, so a version costs nothing extra while no site uses it.
Built-in versions
| Version | Notes |
|---|---|
| 8.5 | |
| 8.4 | |
| 8.3 | Default for new sites. Its container always runs. |
| 8.2 | |
| 8.1 | End of life |
| 8.0 | End of life |
| 7.4 | End of life |
Versions marked eol no longer get security fixes from php.net. That's fine for testing an old client site locally; plan an upgrade for the live site. WP Instances follows php.net's support dates, so a version is marked end of life on the day its support ends.
Built-in versions can't be removed.
Switch a site's PHP version
Use any of these:
- On the Overview tab, open the menu next to PHP and pick a version.
- On the PHP tab (key 2), click Use for this site next to a version.
- In the command bar (Ctrl+K), type
phpand pick Switch to PHP ….
The switch runs as a job with four steps:
- Start PHP x.x: starts that version's container. The first time you use a version, its container is built, which takes a few minutes, once. After that, switching takes seconds.
- Check the site's code: WordPress is booted once under the new version. Fatal errors, typically from a plugin or theme that doesn't support that PHP version, show in the job log.
- Route the site to PHP x.x: the site is sent to the new container.
- Load the site: the homepage is requested, and the log shows the answer and the PHP version that served it.
If WordPress fails to boot or the homepage answers with a server error, the site is still switched, so you can debug it, and the log says you can switch back at any time. See Debugging.
Everything WP Instances runs on the site with WP-CLI, such as restores, URL rewriting and sign-in links, uses the site's own PHP version, so plugins behave the same as in the browser.
Duplicating a site keeps its PHP version.
Which version for which WordPress
Each WordPress release needs a minimum PHP version:
| WordPress | Needs PHP |
|---|---|
| 7.0 and newer | 7.4 or newer |
| 6.6–6.9 | 7.2.24 or newer |
| 6.3–6.5 | 7.0 or newer |
| 6.2 and older | 5.6 or newer |
The PHP tab shows the minimum for the site's WordPress (for example 6.8 — needs PHP 7.2.24 or newer) and marks versions below it too old for WordPress x.x. If you switch to one anyway, the job log warns that the site will only show an error. When a site's PHP is too old for its WordPress, the critical-error banner says so.
So the old releases (5.6–7.3) are for restored sites that still run an older WordPress.
The PHP tab
This site shows:
| Row | What it shows |
|---|---|
| Selected version | The version the site uses, and whether it's end of life. |
| Exact release | The precise PHP release running, for example 8.3.x. If the container isn't running, it says so. |
| WordPress | The site's WordPress version and the PHP it needs. |
| Container | The name of the PHP container, for example php (wpx-php-1). |
memory_limit, upload_max_filesize, post_max_size, max_execution_time, max_input_vars, OPcache |
The settings pages are actually served with. |
Below it is the list of loaded PHP extensions.
Installed versions lists every version with its status:
| Status | Meaning |
|---|---|
| running | Its container is running. |
| ready | Built, not running. |
| builds on first use | Not built yet. The first site switched to it builds it. |
It also shows which sites use each version, default, added and eol marks, and Remove for versions you added that no site uses.
PHP settings
Every version, built-in or added, uses the same settings:
| Setting | Value |
|---|---|
memory_limit |
512M |
upload_max_filesize |
4096M |
post_max_size |
4096M |
max_execution_time |
900 seconds |
max_input_vars |
10000 |
| OPcache | On. Changed files are picked up within 2 seconds. |
display_errors |
Off, as on real hosting. Errors are logged instead. Turn on Show on page on the Debug tab to print them in pages. |
Every version has the extensions WordPress needs: mysqli, gd (JPEG, PNG, WebP, FreeType), zip, intl, exif and OPcache, plus WP-CLI.
Add a PHP version
You can add any official PHP image from Docker Hub (php:<version>-fpm):
- a minor version, such as
7.3 - an exact release, to match a live server, such as
8.2.12 - a new release as soon as it's published, such as
8.6
Versions from 5.6 up are accepted.
- Open the PHP tab (key 2).
- Under Add a PHP version, type the version and click Add version. For older releases you can click one of the buttons after Older releases: (5.6, 7.0, 7.1, 7.2, 7.3).
- A job runs with three steps: Find the official image, Build PHP x.x and Check it works.
WP Instances checks the image exists on Docker Hub, builds it with the same extensions and settings as the built-in versions, then checks that it starts and has mysqli. If anything fails, nothing is added. When it's done, the version appears in every site's PHP menu.
Adding a version needs an internet connection. Add another version… at the bottom of the Overview tab's PHP menu takes you to the PHP tab.
Legacy builds
Releases older than 7.4 use a legacy build: their system packages come from the Debian archive, and they get WP-CLI 2.11, the last version for PHP 5.6–7.1.
Remove an added version
Click Remove next to the version and confirm. Its container and image are deleted; you can add it again later. Remove only appears while no site uses the version. Switch those sites to another version first.
Idle containers
A version's container only runs while at least one site uses it. When the last site on a version switches away or is deleted, its container stops. When WP Instances starts, it starts the containers your sites use. The default version, 8.3, always runs.
Each version you've used takes disk space (about 500–700 MB), even when it isn't running. Removing an added version frees it.