Upgrade your site to a newer PHP version safely

Check compatibility, test the new PHP version on a staging subdomain, switch the live site and watch the error log.

IntermediateAbout 30 minutes7 steps

What you’ll need

  • DirectAdmin access
  • A backup
  • A staging copy of the site (optional but recommended)

Newer PHP is faster and supported, but old code can break. Testing first turns a risky change into a routine one.

Steps

  1. Step 1: Record the current version

    Check with Site Health or a phpinfo file. How to check which PHP version your site is using

  2. Step 2: Update the application

    Update your CMS, themes, plugins and Composer dependencies first.

  3. Step 3: Set staging to the new version

    On a staging subdomain (Using a subdomain as a staging site), open Account Manager then Domain Setup, select the subdomain and choose the new PHP version.

  4. Step 4: Test staging and read its log

    Click through key pages, log in, submit forms. Then read the error log for Fatal errors. How to find PHP errors (error logs and display_errors)

  5. Step 5: Fix or replace incompatible code

    Update or replace anything named in fatal errors. Deprecation notices can be noted for later. Choosing a PHP version: compatibility and support dates

  6. Step 6: Switch the live domain

    At a quiet time, change the live domain’s PHP version in Account Manager then Domain Setup. How to change the PHP version in DirectAdmin

  7. Step 7: Watch the live error log

    Test the same pages and check the error log for the next hour.

Check it worked

The live site runs on the new PHP version (confirmed in phpinfo or Site Health) with no new fatal errors in the log.

If something goes wrong

What happensWhat to do
Site breaks after switchingSwitch back immediately, then fix on staging.
phpinfo still shows the old versionYou checked a different domain folder, or a cached page.

New to Traxio? The PHP hosting page lists the PHP versions, database and tools every account gets, free for the first 30 days.

Popular

Tip: press / to search from any pageSee all results