ServerAvatarDocs
Server management

PHP

Install PHP versions, pick the default, set the common php.ini limits, switch extensions on and off, install ionCube and edit php.ini with a safety copy.

A server can run several PHP versions side by side. Each application pins the one it wants, so a legacy site on 7.4 and a new one on 8.4 live on the same server without arguing.

PHP (under Software in the sidebar) is where you install those versions, choose which one the bare php command means, and manage the settings and extensions each version offers. The screen has two parts: the Installed versions table, and Settings for PHP 8.4 below it for the version you selected.

The PHP screen: the Installed versions table with PHP 8.4.28 marked Default and Supported and used by 2 applications, an Install version button, and below it the Common settings tab for PHP 8.4 with five fields

PHP is not managed on Docker servers

A server installed with the Docker stack serves no PHP sites, so the PHP item is missing from the sidebar. If you open the address anyway, the screen reads "PHP is not managed on this server". PHP is still installed there for the panel itself; restart its service from Services.

The Installed versions table

Each installed version is one row with four columns:

  • Version — the exact release, for example PHP 8.4.28, with a Default badge on the version that the php command runs. A row can also carry Incomplete, Installing, Removing or Install failed.
  • Support — Supported, Security fixes only or No longer supported. The date support ends (or ended) shows under the badge for the last two. When the panel has no PHP release schedule (a server that cannot reach it gets none), the column is left out rather than guessing.
  • Used by — how many applications run on this version. Click the count to see their names (up to five); each name opens the Applications list searched for it.
  • Actions — Make default and Remove, described below.

Click a row to select it. The settings below the table then belong to that version, and your choice stays in the address, so reloading keeps your place. With more than one version installed a PHP versions picker also appears next to the settings heading.

Make a version the default

Click Make default on the row. It takes effect at once and the screen says "PHP 8.5 is now the default." The default only decides what the plain php command and plain php cron jobs run. If any cron jobs have no version of their own, the message lists the ones that now run on the new default (three names, then "and N more").

Changing the default does not move your applications

Each application keeps its own version. To move an application, use its PHP settings screen.

Make default is disabled on a version that is still installing or being removed, and on an Incomplete one ("Complete the install first — the default PHP is what runs when nothing pins a version.").

Install a version

  1. Click Install version. The dialog lists only versions this server can really install, and the oldest one offered is PHP 7.4. Each entry carries its support badge, and a version already installed is tagged Installed.

    The Install a PHP version dialog with a Version dropdown set to PHP 8.6 and a Supported badge, and Cancel and Install buttons

  2. Choose the Version and click Install. A version past end of life shows the warning "PHP 7.4 no longer gets security fixes. Install it only if an application needs it."

The row appears at once with a badge that walks through Preparing, Downloading, Unpacking and Configuring; the page refreshes on its own. If another install is already running, the badge reads Waiting for another install and starts when that one finishes. Installing takes a few minutes. While it runs, the settings area shows "PHP 8.5 is still installing" instead of the tabs, because there is no extension list or php.ini yet.

If every version the server offers is already installed, the dialog says "Every version this server offers is already installed." A server with no PHP shows No PHP installed and an Install version button.

When an install does not finish

  • Install failed — nothing was installed, so the row offers Try again and Dismiss. Try again starts the install again; Dismiss clears the failed entry. The row shows the last lines of apt's output, and the area below the table explains the failure and gives a reference you can pass to support.
  • Incomplete — the version is present but a base package is missing. The row names the missing packages ("Missing php8.4-fpm. Complete the install to add them.") and offers Complete install.

Remove a version

Click Remove and confirm Remove PHP 8.3?: "Its extensions and settings go with it. You can install it again later." Removing takes a few minutes and shows a Removing badge. If it fails, the row shows Removal failed and the version stays installed.

Remove is not available when:

  • the version is the one the panel itself runs on — the button is hidden and the screen says "The panel itself runs on this version.";
  • it is the default ("This is the default version.") — make another version the default first;
  • applications use it ("2 applications use this version.") — change those applications first;
  • cron jobs use it. The panel then answers "PHP 8.3 is used by cron jobs: … Switch them to another version or delete them first."

Common settings

The Common settings tab shows the limits people most often change, as fields, so you do not have to edit the file. They apply to every application on this PHP version; an application's own PHP settings override them.

Fieldphp.ini nameAccepts
Memory each request may usememory_limitA size such as 128M, 1G or 512K, or -1 for no limit. At most 12 characters.
Biggest file someone can uploadupload_max_filesizeA size, same format.
How long a page may runmax_execution_timeA whole number of seconds, 0 to 3600.
How long an upload may takemax_input_timeSeconds, 0 to 3600, or -1 for no limit.
Fields a form may containmax_input_varsA whole number, 100 to 100000.

A field that the file does not set shows Not set (PHP default). Hover the ⓘ next to a field for what it does.

  1. Change one or more fields. A field you leave empty is left as it is in the file; only the fields you changed are written.

    When you raise the upload size above the current post_max_size, the panel raises post_max_size to the same size and tells you ("post_max_size will be raised to 64M too, or uploads that size would still fail."). It is never lowered.

  2. Below the fields, Keep a copy of the current settings appears once you have changed something. It is on by default and keeps the old file as php.ini.panel-bak next to the live one. If you turn it off, a red note warns that without a copy the old settings are only held in memory while the new ones are checked, and cannot be put back if the panel stops during the save. The switch is on again after every save or discard.

    The Common settings tab after changing the memory limit to 256M and the upload size to 64M, showing the note that post_max_size will be raised too and the Keep a copy of the current settings switch turned on

  3. Click Save PHP settings. The panel rewrites only those lines, checks the result and reloads PHP. A toast says "PHP 8.4 settings saved." Discard puts the fields back to what is in the file.

Save PHP settings stays disabled while "Nothing has changed".

Extensions

The Extensions tab lists what this version can load. The badge on the tab counts the extensions you can switch, and the summary reads "18 of 80 turned on." Each row shows the name, a one-line description (gd: Resizes and crops images, intl: Formats dates, numbers and currency for other languages) and an On / Off switch.

The Extensions tab for PHP 8.4: the summary 18 of 80 turned on, a search box with All, On and Off buttons, and rows such as bcmath and gd with switches turned on and curl and igbinary marked Needed by the panel

  • Use Search extensions, or the All / On / Off buttons, to narrow the list.
  • Switching an extension on installs its package if it is missing, so it can take a few minutes. The row shows Starting and then Installing… until it finishes, and the other switches wait ("Wait for gd to finish first.").
  • Needed by the panel (with a lock) — the panel itself uses this extension on the PHP version it runs on, so it cannot be switched off. Trying anyway is refused with "Turning the extension off would take the panel offline — it needs …" (naming the modules it needs).
  • A row can say On for websites, off for the command line (or the reverse, or On for some uses only) when the web and command-line PHP configurations disagree.
  • Built into PHP (N) at the bottom is a collapsed list of extensions that are compiled in. They are always available and have no switch. Searching for one tells you so, for example "json is built into PHP — it is always available."

OpenLiteSpeed works differently

On an OpenLiteSpeed server an installed extension is always on. You can install one from this screen, but not switch it off again.

ionCube

The ionCube tab holds the ionCube Loader, which encrypted PHP software such as WHMCS needs. It is not an ordinary extension (it is a file from ionCube, not an apt package), so it has its own tab. The tab badge shows On, Off, Installing, Removing, Failed or Unavailable.

The ionCube tab for PHP 8.4 showing the ionCube Loader as Not installed, the line "Needed by encrypted PHP software, such as WHMCS.", the Keep a copy of the current settings switch and an Install button

  1. Open the ionCube tab of the version your software runs on.
  2. Leave Keep a copy of the current settings on, unless you have a reason not to. The installer changes the PHP configuration files and reloads PHP; the switch decides whether recovery copies of those files are kept on disk.
  3. Click Install. It takes a few minutes and the page updates on its own. When it is done the card reads Installed and shows the loader version (Loader followed by its number).

To take it out again, click Remove and confirm Remove the ionCube Loader? ("Any application on PHP 8.4 running encrypted software will stop working until it is installed again."). The confirmation has its own Keep a copy switch.

If the install fails, the card shows the reason and the button becomes Try again.

  • "ionCube publishes no loader for PHP 8.0. Use another version for software that needs it." — Unavailable: ionCube has no loader for that PHP version.
  • "Installed outside the panel (by an earlier version or a system package). It is removed together with PHP 8.4." — the panel shows it but does not change it. A loader that ServerAvatar v7 installed has to be removed first, then installed again from here.

Edit php.ini

The php.ini tab opens the whole file as PHP reads it, with its path above the text (for example /etc/php/8.4/fpm/php.ini) and a copy button. Use it for anything the Common settings tab does not cover.

  1. Click in the file and make your change. As soon as the text differs, the controls appear below it.

  2. Tick "I understand a mistake here can take every application on PHP 8.4 offline." The Save and reload button stays disabled until you do (hover it to see why: "Confirm you understand the risk first." or "Nothing to save — the file has not been changed.").

  3. Leave Keep a copy of the current settings on to keep the old file as php.ini.panel-bak, or turn it off (a red note explains the risk).

  4. Click Save and reload. The panel writes the file, tests it with PHP-FPM's own configuration test and reloads PHP. If PHP rejects the file, the old one is put back, nothing is reloaded, and the error appears under the editor. The file can be at most 262144 bytes (256 KB).

    The php.ini editor after a change: the file in a dark pane, the acknowledgement box, the Keep a copy of the current settings switch, and the Discard changes and Save and reload buttons

Discard changes puts the original text back. If you saved on the Common settings tab in the meantime, the editor tells you "This file was changed on the Common settings tab. Reload it before saving, or your save will undo that change" and offers Reload file. The editor also stops you from leaving the page or switching version with unsaved text.

This file is server-wide

Every application on this PHP version is affected. For limits that belong to one site (memory limit, upload size, execution time) use that application's PHP settings instead.

Limits

  • PHP 7.4 is the oldest version the panel offers. Only versions in the server's package repository can be installed, and the version must be written as major and minor (8.4).
  • One install or removal runs at a time on a server; others wait in the queue.
  • The version the panel itself runs on cannot be removed. Its extensions the panel needs cannot be switched off.
  • The php.ini editor accepts at most 256 KB of text.
  • On OpenLiteSpeed, extensions cannot be switched off once installed.

Who can do this

  • The PHP permission controls the whole screen. View lets a role read the versions, extensions, settings and php.ini; Manage is needed to install, remove, make default, change settings, switch extensions, install ionCube and save php.ini. A role with View only sees the values but cannot change them.
  • Starting, stopping and restarting the PHP-FPM service stays on Services.

Common errors

  • That version could not be installed. — the install request was refused. Read the line the server adds: "PHP 7.3 is past its end of life and is no longer offered for new installs. Choose PHP 7.4 or newer." or "PHP 8.7 is not in this server's package repository, so it cannot be installed."
  • PHP 8.3 is used by 1 application: …. Change those applications first. — move the listed applications to another version, then remove it.
  • This is the default version. Choose another default first. — make another version the default, then remove this one.
  • The php.ini could not be saved. — PHP refused the new file and the old one was restored. Fix the line the error points to.
  • That extension could not be changed. — read the detail the server adds, for example that the extension is compiled in or that the panel needs it.
  • We couldn't read this server's PHP setup. — the panel could not reach the server's API. Reload; if it persists, check System logs.

On this page