How to change your PHP version
Switching the PHP version your account runs, and what to test straight afterwards.
PHP is the language most website software on shared hosting is actually built in — WordPress, most other content management systems, and a huge amount of custom code. Which version of it your account runs affects speed, security, and whether your software works at all, and it is something you can change yourself without contacting support.
Why the version matters
Each major PHP version brings performance improvements and, eventually, the end of security updates for the one before it. Running a version that is no longer receiving security fixes leaves known vulnerabilities unpatched on your site — not a theoretical risk, since PHP's popularity makes older versions a common target. Running a newer version than your software supports causes the opposite problem: outright errors, because functions the software relies on have changed or been removed.
The aim is not "as new as possible" or "whatever it already is" — it is the version your specific software is built to run on, kept reasonably current as that software itself is updated.
Checking what you are on now
Open the section of your control panel dealing with PHP settings. It should show the version currently active for the site, generally as a straightforward version number such as 8.1 or 8.2. If you would rather confirm it from inside the site itself, a small PHP file containing <?php phpinfo(); ?> uploaded temporarily and then visited in a browser will report the running version in detail — delete the file again afterwards, since phpinfo() exposes configuration detail you do not want left publicly accessible.
Checking compatibility before you switch
A PHP upgrade that breaks a site does so immediately and visibly — a fatal error, a blank page, or an admin area that will not load. Checking compatibility first is far less disruptive than discovering the problem after the switch, particularly on a site people are actively using.
- Check your CMS's stated requirements. WordPress, for instance, publishes both a minimum supported PHP version and a version it currently recommends — these are not the same thing, and the recommended one is usually the better target.
- Check plugins and extensions individually. A CMS itself supporting a PHP version does not guarantee every plugin does. An outdated or abandoned plugin is the most common single cause of a failed PHP upgrade.
- Check any custom code. If a developer built something bespoke for the site, ask them directly whether it has been tested against the version you are moving to.
Making the change
-
Take a backup first
However confident you are that everything is compatible, have a way back to the current state before you change anything. See restoring a file from a backup if you need to reverse the change afterwards.
-
Open the PHP settings section
Find the area of your control panel dealing with PHP. It typically presents available versions as a dropdown or a simple list to choose from.
-
Select the version you want and save
The change usually takes effect within a few seconds to a minute, without needing anything restarted manually on your end.
-
Test the site immediately
Load the front end of the site, then log in to the admin area if it has one. A fatal error will usually show up straight away on either.
If the site breaks after switching
A white screen or a visible fatal error after a PHP version change points to something on the site that is not compatible with the new version. Your first move is the error log, which will typically name the exact file and line the error came from — often inside a specific plugin's folder, which tells you immediately where to look.
If you cannot resolve the incompatibility quickly, switching back to the previous PHP version from the same settings screen removes the immediate problem while you deal with the underlying plugin or code at a less urgent pace.
What individual settings you can also adjust here
The same area of the control panel that controls PHP version often exposes a handful of PHP configuration directives you can adjust within limits set by the hosting plan:
| Directive | Controls |
|---|---|
memory_limit | How much memory a single PHP process is allowed to use |
upload_max_filesize | The largest single file a script can accept as an upload |
max_execution_time | How long a script can run before it is stopped |
post_max_size | The largest amount of data a form submission can send in total |
These are worth knowing about if you ever hit an upload size error or a script timing out, but changing PHP version and adjusting these values are two separate jobs — a version switch alone will not change any of them.
Frequently asked questions
Will changing PHP version break my site?
It can, if something on the site — an old plugin, a theme, custom code — relies on behaviour that changed between versions. This is exactly why checking compatibility and testing immediately after the change matters, rather than switching and walking away.
How do I know which PHP version I actually need?
Check the documentation for your CMS and for each plugin or extension you rely on — most state a minimum, and often a recommended, PHP version. WordPress itself publishes recommended versions on its own site.
Related reading
Run the newest PHP version your application supports and that still receives security updates — rarely the oldest one that merely still works.
How to upgrade PHP without breaking your siteCheck compatibility, test on staging, then switch the live version over — the order that keeps a PHP upgrade from taking your site down.
How to read your website error logsFinding the error log for your site and making sense of the lines it writes.
A tour of your hosting control panelThe main sections you will find in your control panel and roughly what lives in each one.