Skip to main content

How to change the PHP version of an environment

Learn how to switch your environment’s PHP version with zero downtime, test the change, and roll back if needed.

Overview

PHP is the programming language that powers WordPress, and the version your sites run on affects their security, performance, and compatibility with plugins and themes. On Levamo, you can change your environment’s PHP version from the dashboard with zero downtime, so you can test an upgrade and roll back yourself if something doesn’t work.

PHP versions are set at the environment level, so every site in an environment, including staging sites, uses the same version.

In this article, you will find how PHP versions work on Levamo, step-by-step instructions for changing and reverting your PHP version, and guidance on troubleshooting compatibility issues.


How PHP Versions Work on Levamo

Each environment runs a single PHP version, and every site in it uses that version.

  • Current version: Shown on the PHP card in your environment’s Manage tab, and in the Change PHP version window

  • Zero-downtime switching: Your sites stay online while the PHP version changes

  • First switch: If your environment isn’t on the latest LiteSpeed version, the switch updates LiteSpeed first. This redeploys the environment, and your sites are offline for a few minutes. The Change PHP version window tells you if this applies before you confirm. After that, every switch is fast and has no downtime.

  • Security patches: Levamo deploys critical PHP security patches within your current PHP series. You don’t need to select a new version to receive them.

  • Patch builds: Each PHP version shows its current build number. If a newer build of your current version is available, it appears next to it, and you can apply it from the same window.

  • Supported versions: Older PHP versions eventually stop receiving security updates. See the official PHP supported versions for current information.

Note:

A security patch doesn’t change your PHP series. For example, a patch may move your environment from PHP 8.5.3 to PHP 8.5.12 without any action from you.

For more information about environments and sites, see Understanding the structure of your Levamo account.


Prerequisites

Before changing your PHP version:

  • Backups: Back up every site in the environment. See Creating and managing backups.

  • Updated software: Make sure WordPress core, plugins, and themes are up to date.

  • Compatibility: Check that your plugins, themes, and custom code support the PHP version you plan to use.

  • Timing: Choose a low-traffic period. The switch itself has no downtime, but an incompatible plugin or theme will affect your live sites until you fix it or roll back.

Important:

Staging sites share the environment's PHP version with production sites. You cannot independently test a different PHP version on staging within the same environment.


How to Change Your PHP Version

Step 1: Open your environment

Sign in to the Levamo dashboard, click Environments in the main menu, then click Manage environment next to the environment you want to update.

Step 2: Open the Change PHP version window

Click the Manage tab. Under Settings, find the PHP card and click Change PHP version.

Step 3: Select a PHP version

Under Available PHP versions, select the version you want. Your current version is marked Current, and each version shows its build number. You can upgrade to a newer version or select an older one if you need it for compatibility.

If a newer build of your current version is available, it’s shown next to the build number. Keep your current version selected to apply that update.

Step 4: Review and confirm

Read the messages at the bottom of the window. They confirm which version your sites will move to and whether a LiteSpeed update is needed first. Click Switch version to proceed.

The change runs in the background. Your sites stay online, but you can’t make other changes to the environment until the switch finishes.

Note:

If the window says your environment will first move to a newer LiteSpeed version, your sites will be offline for a few minutes while the environment redeploys. This happens only once.

Step 5: Check your sites

Once the switch completes, check every site in the environment. Pay particular attention to:

  • Pages and WordPress admin access

  • Forms, checkout, logins, and other key functionality

  • PHP errors or warnings in your site logs


Troubleshooting PHP compatibility issues

If a site stops working correctly after a PHP change, the most likely cause is a plugin, theme, or custom code that doesn’t support the new version. Common symptoms include critical errors, blank pages, or features that stop working.

To investigate:

  1. Identify incompatible components: See Troubleshooting WordPress plugins using Levamo dashboard.

  2. Update or replace affected components: Move to a compatible version or an alternative where possible.

Tip:

If your sites are affected and you can’t find the cause quickly, roll back to your previous PHP version first, then troubleshoot. Rolling back has no downtime.


How to revert to a previous PHP version

If you can’t resolve a compatibility issue, you can switch back to your previous version, as long as it’s still listed.

Step 1: Open the Change PHP version window

Open your environment, click the Manage tab, and click Change PHP version on the PHP card.

Step 2: Select your previous version

Select the version you were using before and click Switch version. Your sites stay online while the change runs.

Important:

Reverting your PHP version doesn’t restore a backup. Any changes made to files or databases since the switch remain in place.


FAQ

Will my sites go offline when I change PHP versions?

No. The only exception is the first switch on an environment that isn’t on the latest LiteSpeed version. The Change PHP version window tells you before you confirm, and sites are offline for a few minutes while the update runs.

Why did my first PHP switch take longer than expected?

Your environment was updated to the latest LiteSpeed version as part of that switch. This happens only once. Future switches are fast with no downtime.

Can different sites in the same environment use different PHP versions?

No. All sites in an environment, including staging sites, share the same PHP version. Sites that need different PHP versions must be hosted in separate environments.

Can I change PHP settings such as upload limits and timeouts?

Yes. PHP configuration settings are managed at the site level, separately from the PHP version. Open your site and go to Manage → PHP to access the php.ini file. These are advanced settings and don’t change the environment’s PHP version.

Can I use an older PHP version?

You can select any version listed in the Change PHP version window. Older versions may no longer receive upstream security updates, so we recommend a currently supported PHP version whenever possible.

Does Levamo update my PHP version automatically?

Levamo deploys critical PHP security patches within your current PHP series. We don’t move your environment to a different series automatically. For example, moving from PHP 8.4 to PHP 8.5 is something you do from the dashboard.

This means you stay in control of PHP compatibility upgrades, while Levamo handles critical security patch deployment within your selected series.

How do I know whether a PHP security patch has been applied?

Levamo deploys critical PHP security patches across affected environments as part of our managed hosting service. The Change PHP version window shows your current build and whether a newer one is available, but it shouldn’t be your only indicator, since critical patches can be deployed to your environment without you selecting a new version.

If you’ve received a security advisory or want to confirm your environment is protected against a specific vulnerability, contact our support team. We can check the PHP build running on your environment and confirm its patch status. You don’t need to change your PHP version unless our team asks you to.


Conclusion

Changing your PHP version is a quick, zero-downtime task, so you can stay on a supported version and test upgrades without planning a maintenance window. Check compatibility first, review your sites after the switch, and roll back if anything breaks. If you run into issues, our support team is available 24/7.

Did this answer your question?