PHP versions
A PHP version and settings per site through PHP-FPM, a compatibility check before you switch, and every PHP version on this machine.
- Where
/services/php, and each site's Server and PHP tab- Per site
- Its own version and settings, in a PHP-FPM pool
dmp-<folder> - Never edited
php.ini: the panel keeps its settings in99-devmagic-panel.ini- Profiles and traces kept
- 3 days
On this page
Each site can run its own PHP version with its own settings, through a PHP-FPM
pool of its own. The panel installs and updates the versions, keeps its
settings apart from php.ini, and checks a site's code before you switch it.
Give a site its own version
A site's Server and PHP tab sets its PHP version and settings. They run
through the site's own PHP-FPM pool, dmp-<folder>, which is also the record
of which site runs what.
The tab checks the version against what the site's composer.json, plugins
and themes ask for. The WP-CLI the panel runs for the site follows its version.
After a switch
The panel opens the home page, wp-login.php and wp-admin signed in. Then it
reads only what the site's Apache error log and debug.log got since the
switch, so a new PHP fatal error shows up at once. Undo on the job puts the
old version back.
Sites without a version of their own
They run on mod_php, or, once mod_php is off, on the machine's default version through PHP-FPM. A site with its own version always runs on PHP-FPM.
Check a site before you switch
Compatibility on the Server and PHP tab scans the site's code against a PHP version, for what that version removed (errors) or deprecated (warnings). Each finding has its file and line. It scans:
- the active theme, and its parent
- the active plugins
- must-use plugins and drop-ins
- the
vendorfolder
Picking another version on the tab shows what the last check found for it.
Every site against one version
A version's Sites section (/services/php/<version>/sites) checks every
site against that version in one job. Its table shows each site's errors and
warnings, and the plugins or theme they are in.
Note The check is a hint: it never blocks a switch.
The scanner is PHPCompatibilityWP on PHP_CodeSniffer. It is fetched once with Composer into the panel's data folder, and runs on the checked version's own PHP.
The PHP page
Services, PHP (/services/php) starts with PHP on this machine: which
version sites without their own run on, and how, with a tile per installed
version. Below it is everything of the version you pick, at
/services/php/<version>, one section under the other:
| Section | Address ends in | What it holds |
|---|---|---|
| Settings | /settings |
The panel's settings for the web and the command line |
| Modules | /modules |
Module packages from apt, and the modules on or off |
| Sites | /sites |
Every site's code checked against the version |
| Xdebug | /xdebug |
Xdebug and its modes for the version |
| php.ini changes | /ini |
What each php.ini changes from the packaged one |
| PHP info | /info |
PHP info and Xdebug info |
A link to a section scrolls to it.
Install, update and remove
- Each installed version shows its release, and any newer build apt offers, with Update to in one click.
- Install adds a version apt offers, with PHP-FPM, the command line and the common modules.
- When apt has no other version, the page shows the one-time command that adds the ondrej/php PPA. Adding a package source is left to you.
- Remove takes away a version nothing uses: no site, not the default, not the command line's and not Apache's.
- A version with only the command line, which apt adds when a package without a version follows the newest PHP, has Install PHP-FPM so sites can run on it.
The default and the command line
Make default makes a version with PHP-FPM the one every site without its own PHP runs on, new sites and phpMyAdmin included. Sites with their own version keep it, every site is checked afterwards, and Undo puts them back. A version's own settings and modules do not carry over, so check them first. On a machine still on mod_php, this also turns mod_php off, as Run every site on PHP-FPM does.
Use for the command line makes a version the php command, so WP-CLI
matches the default.
Modules and Xdebug
Add or remove module packages per version, turn modules on or off, and see the parts installed: mod_php, PHP-FPM and the command line.
Xdebug switches per version, in any mix of its modes: debug, develop, profile, trace, gcstats and coverage. With profile, trace or gcstats on, Xdebug writes to the panel's own folder, and the files are deleted after 3 days. A site's Performance tab lists its profiles.
PHP info
PHP info and Xdebug info, for the web and the command line, asked from PHP itself. Password-like settings are hidden.
Change settings without editing php.ini
The panel keeps its own settings per version, for the web and the command line,
in 99-devmagic-panel.ini: memory, uploads, time limits, errors, OPcache and
more. Limits, and every group with a value set here, open; the rest fold, with
what is inside them.
Note
php.iniis never edited.
php.ini changes shows what each php.ini changes from the packaged one. A
job moves those changes into the panel's settings, and php.ini goes back to
the packaged one.
Run every site on PHP-FPM
A machine with mod_php keeps it until you switch. A new install on a machine without mod_php starts on PHP-FPM.
Before sites move
Before sites move to PHP-FPM checks every site for what changes:
php_value lines, .user.ini files, phpMyAdmin, and where a version's Apache
and FPM settings differ. Make PHP-FPM match Apache brings a version's FPM
settings in line with its mod_php.
The switch and the way back
Run every site on PHP-FPM runs every site without its own version on the one you pick:
- mod_php goes off and Apache moves to mpm_event.
- phpMyAdmin runs in a pool of its own.
- No vhost can send PHP source.
- Every site is checked afterwards, and Undo turns mod_php back on.
It is refused while the check lists php_value lines, or while the version's
PHP-FPM differs from its mod_php. Run sites on mod_php again goes the other
way, with mpm_prefork; sites with their own version keep it.
Checked against devmagic-panel 1.67.0.