Skip to content

Change PHP Version in FlyWP Site

This guide explains how to update the PHP version and configure PHP settings for a site in FlyWP.

  1. Log in to your FlyWP dashboard.

  2. Go to Sites and select the target site.

  3. In the left sidebar under Configurations, click PHP.

    Site sidebar with Configurations expanded and the PHP item highlighted

Available PHP Versions & Changing Versions

Section titled “Available PHP Versions & Changing Versions”

The available PHP versions depend on your site's web server:

  • Nginx sites: PHP 7.4, and 8.0 through 8.5 (7.4, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5).
  • OpenLiteSpeed (OLS) sites: PHP 7.4, and 8.1 through 8.4 (7.4, 8.1, 8.2, 8.3, 8.4).

To switch versions:

  1. Locate the PHP Version dropdown.

    PHP Settings page with the PHP Version dropdown highlighted

  2. Select your desired version.

  3. Click Save Changes.

FlyWP will automatically reconfigure PHP-FPM for the selected version.

The PHP configuration page also allows you to tune performance and runtime values directly from the dashboard:

  • Memory Limit: Maximum memory allocated to each PHP script (e.g., 256M, 512M).
  • Max Execution Time: Maximum duration in seconds a script is allowed to execute.
  • Max File Upload: Maximum number of files that can be uploaded at once.
  • Max File Upload Size: Maximum size of a single uploaded file (upload_max_filesize).
  • Max Input Time & Max Input Vars: Maximum time spent parsing request data and maximum number of input variables accepted.
  • Process Manager: Configure PHP-FPM pool settings (process manager mode, max children, start servers, and spare servers).
  • OPCache & JIT (Nginx sites only): Enable or disable PHP OPCache for pre-compiled script caching, and the JIT (Just-In-Time) compiler. JIT is shown on PHP 8.0 or newer, including 8.3, 8.4 and 8.5, and needs OPCache on. New sites start with JIT off; a site with no saved JIT value shows it on. If the site returns 502 errors after you turn JIT on, turn it off and save.

Click Save Changes to apply your adjustments.

Need a setting the dashboard does not offer? See Advanced: Edit PHP Configuration Without the Dashboard.

PHP 7.4, 8.0 and 8.1 are end-of-life (EOL). They no longer get security fixes. FlyWP labels them Outdated & Vulnerable - EOL wherever you pick a PHP version:

  • Create Site: the PHP Version list shows the label, and a security warning appears under the list.
  • PHP Settings: the same label, and a Security Warning notice under the PHP Version field.
  • Sites list: a warning icon next to the PHP version. Hover over the icon to read the message.
  • Site Overview: a Security Warning banner, with a Change PHP version link if you can update the site.

You can still choose an EOL version. FlyWP shows the warning, but it does not change the PHP version of your site. Static HTML and Node.js sites do not show this warning.

  • Move the site to PHP 8.3 or newer. PHP 8.2 reaches end of life on December 31, 2026.
  • Check that your plugins and themes support the new version first.
  • Make the change on a staging clone, test it, and then apply it to production (see Recommended Workflow).

Advanced: Edit PHP Configuration Without the Dashboard

Section titled “Advanced: Edit PHP Configuration Without the Dashboard”

This section is for advanced users with SSH access who want to change PHP settings the dashboard does not cover. For most sites, the PHP page is all you need.

When you click Save Changes on the PHP page, FlyWP writes your settings into files in /home/fly/<domain>/config/php/ on your server (replace <domain> with your site's domain). Which files are used depends on the site's web server stack.

The PHP container loads these files. The .ini files are mounted into /usr/local/etc/php/conf.d/, and zz-docker.conf into /usr/local/etc/php-fpm.d/ as the PHP-FPM pool file.

FileSettingsDashboard field
memory.inimemory_limitPHP Memory Limit
uploads.iniupload_max_filesize, post_max_size, max_file_uploadsMax File Upload Size, Max File Upload
variables.inimax_execution_time, max_input_time, max_input_varsMax Execution Time, Max Input Time, Max Input Vars
opcache.iniopcache.enable, opcache.jit_buffer_sizeEnable PHP OPCache, Enable JIT Compiler
zz-docker.confPHP-FPM pool (pm, pm.max_children, pm.start_servers, and related)Process Manager Type and the fields under it
custom.iniEmpty by default, not set by the dashboardNone

Saving also updates the site's Nginx limits in /home/fly/<domain>/config/nginx/common/limits.conf:

  • client_max_body_size is set to Max File Upload Size.
  • client_body_timeout, send_timeout and fastcgi_read_timeout are set to Max Execution Time.

OpenLiteSpeed sites use a single file, ols.ini. It is mounted into the OpenLiteSpeed container at /usr/local/lsws/lsphp<version>/etc/php/<version>/mods-available/ols.ini, for example lsphp83/etc/php/8.3/ for PHP 8.3.

FileSettingsDashboard field
ols.inimemory_limit, upload_max_filesize, post_max_size, max_file_uploads, max_execution_time, max_input_time, max_input_varsPHP Memory Limit, Max File Upload Size, Max File Upload, Max Execution Time, Max Input Time, Max Input Vars
  • The other files in config/php/ (memory.ini, uploads.ini, variables.ini, opcache.ini, zz-docker.conf and custom.ini) are present but not mounted, so editing them has no effect on an OpenLiteSpeed site.
  • The dashboard does not show Process Manager Type, Enable PHP OPCache or Enable JIT Compiler for these sites. OpenLiteSpeed does not use PHP-FPM, and ols.ini has no OPCache lines.
  • When you change the PHP version, FlyWP also updates the lsphp path in /home/fly/<domain>/config/ols/httpd_config.conf.

The server-wide Nginx proxy in front of all sites gets a client_max_body_size set to the largest Max File Upload Size of all sites on the server.

Pick the place by what you want to change. Only .user.ini survives a dashboard save; everything in config/php/ is reset (see What Happens When You Click Save Changes).

You want toNginx sitesOpenLiteSpeed sites
Change a value the dashboard has (memory, uploads, execution time, input vars; on Nginx also pool size and OPCache)The PHP pageThe PHP page
Change memory, upload, execution time or input vars per site and keep them after dashboard savesapp/public/.user.iniols.ini (reset on save)
Add a PHP directive the dashboard does not have, such as date.timezonecustom.ini (reset on save)ols.ini (reset on save)
Change PHP-FPM pool settings, or set a PHP value that .user.ini cannot changezz-docker.conf (reset on save)No PHP-FPM pool; set PHP values in ols.ini (reset on save)

When you click Save Changes, FlyWP runs these steps in order:

  1. Resets the site's config folder to FlyWP's default copy (git reset --hard, then git pull).
  2. Writes your dashboard values into the files in config/php/, and updates the Nginx limits for the site and for the server proxy.
  3. Recreates the site's containers.
  4. Sets WP_MEMORY_LIMIT in wp-config.php to the memory limit you chose.

PHP Settings page with the PHP values and Save Changes highlighted

For per-site changes, a .user.ini file is the safest option on Nginx sites. It lives in your site's files, so dashboard saves do not touch it.

These steps are for Nginx sites. On OpenLiteSpeed sites, use ols.ini instead.

  1. Connect to your site over SSH or SFTP. See SSH Keys and Site-Specific SFTP Access.

    The SFTP tab of a site showing the IP address and port

  2. Create the file in your web root, /home/fly/<domain>/app/public/.user.ini. A file in app/ (one level up) is not read.

  3. Add the settings you want, for example:

    memory_limit = 512M
    max_execution_time = 180
    max_input_vars = 5000
    upload_max_filesize = 256M
    post_max_size = 256M
  4. Wait up to 5 minutes for PHP to pick up the file. To apply the changes right away, restart PHP (this needs SSH as fly):

    Terminal window
    cd /home/fly/<domain> && docker compose restart php

Things to know:

  • .user.ini only supports per-directory settings. These work: memory_limit, upload_max_filesize, post_max_size, max_execution_time and max_input_vars. Most OPCache settings and the PHP-FPM pool settings (pm.*) cannot be set in .user.ini. Use the dashboard for those.
  • PHP re-reads the file every 5 minutes (user_ini.cache_ttl is 300). Each PHP worker keeps its own cache, so for a few minutes some requests can still show the old value.
  • Values in .user.ini override the dashboard for this site. Because the dashboard does not show them, what you see there can differ from what actually runs. Keep a note of what you set.
  • Nginx has its own upload limit (client_max_body_size, 100M unless you raised it). Even with a larger upload_max_filesize in .user.ini, uploads above that limit are still blocked; raise Max File Upload Size in the dashboard to increase it.
  • To check the values that run on your site, open Tools → Site Health → Info → Server in WP Admin. Running wp eval or php -i over SSH uses the command line, not the web server, so it does not show .user.ini values.

Use this approach when you need a setting that neither the dashboard nor .user.ini can set. These edits are lost on every dashboard save (see the caution above), so you must repeat them each time.

Connect to your server as fly first. See SSH Keys.

  1. Open custom.ini for extra directives, or the file that holds the setting (see Nginx Sites):

    Terminal window
    cd /home/fly/<domain>/config/php
    nano custom.ini
  2. Add your directives and save the file.

  3. Restart PHP to apply the change:

    Terminal window
    cd /home/fly/<domain> && docker compose restart php

Always use docker compose restart php. Each file is mounted into the container on its own. Editors and commands such as sed -i replace the file, and the running container can keep the old copy until PHP is restarted. A graceful reload (kill -USR2) does not always pick these edits up.

On Nginx sites, PHP runs under PHP-FPM. config/php/zz-docker.conf is the configuration of its [www] pool, mounted at /usr/local/etc/php-fpm.d/zz-docker.conf. PHP-FPM reads the files in that folder in alphabetical order, so zz-docker.conf overrides the image's www.conf and docker.conf.

The file sets:

  • listen = /run/php-fpm/fpm-www.sock: the socket Nginx uses to reach PHP. Do not change it, or the site stops responding.
  • pm, pm.max_children, pm.start_servers, pm.min_spare_servers, pm.max_spare_servers and pm.process_idle_timeout: written from Process Manager Type and the fields under it on every save.

You can add other pool directives at the end of the file, under the [www] section. For example:

pm.max_requests = 500
request_terminate_timeout = 120s
php_admin_value[memory_limit] = 512M
php_value[max_input_vars] = 3000
  • pm.max_requests restarts each PHP worker after that many requests.
  • request_terminate_timeout stops a request that runs longer than this.
  • php_value[...] and php_admin_value[...] set PHP values for the pool. They override the .ini files in conf.d, including the dashboard values. A .user.ini can still change a php_value, but not a php_admin_value.

Restart PHP to apply, as in the steps above. Like the other files, zz-docker.conf is reset on every dashboard save, and the pool sizes are written again from the dashboard.

  1. Open ols.ini. It is the only PHP file an OpenLiteSpeed site loads, so custom.ini and the other files have no effect:

    Terminal window
    cd /home/fly/<domain>/config/php
    nano ols.ini
  2. Change or add your directives and save the file.

  3. Recreate the site's containers to apply the change. This is what the dashboard does:

    Terminal window
    cd /home/fly/<domain> && docker compose down && docker compose up -d

ols.ini is reset on every dashboard save, like the Nginx files.

If the site stops working after an edit, check the container log for a syntax error, undo your change to that file, and apply again.

On Nginx sites:

Terminal window
cd /home/fly/<domain> && docker compose logs php
cd config && git checkout php/<file>
cd .. && docker compose restart php

On OpenLiteSpeed sites:

Terminal window
cd /home/fly/<domain> && docker compose logs openlitespeed
cd config && git checkout php/ols.ini
cd .. && docker compose down && docker compose up -d

Alternatively, go to the PHP page, change any field (the Save Changes button stays disabled until a field changes), and click Save Changes. That restores FlyWP's defaults for all files in config/php/ and applies your dashboard values.

  • Ensure your application (e.g., WordPress, plugins, themes) supports the selected PHP version
  • Upgrading to PHP 8.x can break outdated plugins
  • Newer PHP versions (8.3/8.4/8.5) offer better performance and lower memory usage
  • Recommended for production unless compatibility issues exist
  • Downgrading PHP may cause fatal errors if code uses newer features
  • Always test before switching in production
  1. Clone site to staging
  2. Change PHP version on staging
  3. Test critical functionality
  4. Apply the same change to production

After switching:

  • Check site loads correctly
  • Review error logs (under Monitoring & Logs → Logs)
  • Verify WP Admin access
  • Monitor performance
  • White screen / 500 error → check PHP error logs
  • Plugin errors → disable incompatible plugins
  • Composer apps → run dependency updates if needed
  • Use PHP 8.3 or newer unless you have legacy constraints, and test on staging first when moving to a newer release
  • Keep PHP version aligned with your stack and framework requirements
  • Periodically review and upgrade

Still stuck? How can we help?

View as Markdown