How to Upgrade PHP Version (From PHP4 to PHP5 to PHP 8)

Still running an old PHP version on your web host? Back in 2009 we had to upgrade PHP4 to PHP5 on our own blog after a string of internal server errors. Today nobody should be on PHP 4 or 5 at all – but the same question still matters in 2026: how do you upgrade your site to a current, supported PHP version safely? This guide shares our original upgrade story and the modern, step-by-step way to switch to PHP 8.x on any hosting control panel.

upgrade php version on hosting

Quick answer: PHP 4 and PHP 5 are long dead and unsafe. Back up your site, update WordPress, themes and plugins, then change the PHP version from your host’s control panel (cPanel MultiPHP Manager or Select PHP Version, Hostinger PHP Configuration, DreamHost Manage Websites). Choose PHP 8.3 or newer, then test your site. Most hosts let you switch back if something breaks.

Our story: upgrading PHP4 to PHP5 in one click

Irritated by internal server errors, I checked the PHP version of our WordPress hosting server and realized our blog was still running PHP 4.4.9, though PHP 5.2.9 was the latest version available. The PHP project had already ended support for PHP 4 on 31 December 2007 and recommended everyone move to PHP 5.2. But the official download did not tell a blogger what to actually do with it – it looked too technical without professional support.

Our host, DreamHost, had announced in August 2008 that new domains could no longer use PHP 4. Our existing server had simply never been switched over. The DreamHost panel usually lets non-technical webmasters do powerful things in a few clicks, and after some browsing I found the option at Domains > Manage Domains > Edit Domain:

php4 to php5 option in DreamHost panel (2009)

There was a drop-down to choose the PHP version. I selected PHP 5.2.x and got this message:

php5 upgraded message (2009)

Five minutes later, when I checked again, we were running PHP 5.2.6. Fast and simple. Back then you could not switch back to PHP 4 once you upgraded – the option simply disappeared from the panel.

Which PHP version should you use in 2026?

According to the official PHP supported versions page, these branches are supported as of late 2026:

  • PHP 8.5 (released November 2025) – security support until end of 2029
  • PHP 8.4 – security support until end of 2028
  • PHP 8.3 – security support until end of 2027
  • PHP 8.2 – security fixes only, ending 31 December 2026

Everything older – PHP 4, PHP 5, PHP 7.x, 8.0 and 8.1 – is end of life and gets no security fixes. WordPress recommends PHP 8.3 or greater. It still runs on PHP 7.4 for legacy hosts, but WordPress itself warns that end-of-life versions may expose your site to vulnerabilities.

How to upgrade your PHP version safely

1. Check your current PHP version

In WordPress, go to Tools > Site Health > Info > Server to see the PHP version. You can also find your WordPress, PHP and MySQL versions with the other methods in our guide.

2. Take a full backup

Back up files and the database using your host’s backup tool or a backup plugin. If the upgrade breaks something, you can restore in minutes.

3. Update WordPress, themes and plugins

Old plugins and themes are the main reason sites break after a PHP upgrade. Update everything first, and replace plugins that have not been updated in years.

4. Test compatibility (optional but smart)

If your host offers a staging site, switch the staging copy first. Developers can also scan code with tools like PHPCompatibility for PHP_CodeSniffer.

5. Change the PHP version in your control panel

  • cPanel hosts: open MultiPHP Manager (or Select PHP Version on CloudLinux servers), pick your domain and choose PHP 8.3 or newer.
  • Hostinger: in hPanel, open your website’s Advanced > PHP Configuration and select the new version.
  • DreamHost: go to Websites > Manage Websites, open the site’s settings and change the PHP version.
  • Managed WordPress hosts: look for a PHP version setting in the site dashboard, or ask support to switch it.

6. Test your site and check error logs

Open the home page, a few posts, the admin area, forms and checkout pages. If you see a white screen or errors, check the PHP error log in your control panel. Unlike our 2009 experience, most hosts now let you switch back to the previous version while you fix the problem.

Why upgrading PHP is worth it

  • Security: unsupported PHP versions get no fixes for known vulnerabilities.
  • Speed: PHP 8.x is much faster than PHP 5 and 7, so pages generate quicker with the same hosting.
  • Compatibility: new WordPress features and plugins increasingly require modern PHP.

While you are at it, consider hiding the PHP version in your site headers so attackers can’t see it easily.

FAQ

Can I still upgrade PHP4 to PHP5?

You shouldn’t. PHP 5 reached end of life in 2018. If you are on PHP 4 or 5, go straight to a supported PHP 8 version, after updating or replacing old code.

Will upgrading PHP break my WordPress site?

Usually not, if WordPress, your theme and plugins are up to date. Outdated or abandoned plugins are the most common cause of errors, so update and back up first.

What is the best PHP version for WordPress in 2026?

PHP 8.3 or newer. WordPress recommends 8.3+, and PHP 8.4 and 8.5 are also actively supported.

Can I downgrade PHP if something goes wrong?

On most modern hosts, yes. You can pick the older version again in the same control panel setting while you fix the issue.

Stuck on a gift? Try our free Gift Idea GeneratorIdeas for anyone by age, job, interests and budget, with Amazon.com and Amazon.in linksFind gifts →

Found this useful? Share it with someone who needs it.

Get our free weekly email: new tech guides and tools, no spam.

New and updated tech guides, a free tool worth bookmarking and one useful pick, once a week. No spam, unsubscribe anytime.

One email a week. Unsubscribe anytime. See our privacy policy.

Related Tech Guides

Leave a Reply

Your email address will not be published. Required fields are marked *

2 Comments

  1. Do you know how to upgrade from Php4 to PHP 5 on a Virtual Dedicated server for other web hosts?

  2. I think most of the server provide this facility but still there are server which doesnt care about user comfortablity and still have a support for only php4

    Thanks
    webburners