Mar 02, 2026
Merkys M. & Aris S.
5min Read
Hypertext Preprocessor (PHP) is an open-source server-side scripting language widely used for web development. It is also used in popular content management systems (CMS), such as WordPress and Joomla.
Since PHP updates frequently, the default version installed on your web server may be outdated. Therefore, it is crucial to understand how to switch PHP versions to maintain your site’s functionality.
This article will explain why and how to change your site’s PHP version. We will also list the prerequisites and answer commonly asked questions about changing the PHP version.
As an essential part of your website, PHP defines how your web page functions. Depending on your goal, you may upgrade or downgrade to another version of PHP.
A PHP upgrade can bring many benefits to your site, namely:
Meanwhile, you may want to downgrade PHP to an earlier version to fix an incompatibility issue. Sometimes, newer PHP versions can’t properly run older plugins, themes, or site codes.
Before switching to a different PHP version, consider the following prerequisites to ensure your site works normally.
Update your CMS before switching to a different PHP version. Since most CMS are based on PHP, an outdated version may trigger incompatibility issues. These issues may prevent PHP codes from running correctly, harming your site’s functionality.
The steps to check your CMS version may vary. To check your current WordPress version, log in to your site’s wp-admin page and navigate to the sidebar → Dashboard → Updates.

WordPress will display the currently active version and the newest stable release. If your WordPress is up-to-date, it will say, “You have the latest version of WordPress.”
Otherwise, it says, “An updated version of WordPress is available.” Simply press the Update Now button to download and install the latest WordPress version.
Your old site code may not execute properly if you use the latest PHP version. This also applies to PHP-based programs, such as WordPress themes and plugins.
To ensure your site works well, update its code, themes, and plugins before upgrading PHP.
There are different ways to check whether your website is compatible with a specific version of PHP. For instance, you can use Hostinger’s WordPress and PHP compatibility checker. This tool examines your site’s core and current PHP version, advising a switch to a compatible version if necessary.
To use the compatibility checker, access your hPanel dashboard and navigate to WordPress → Overview, and locate the PHP Version section. If you’re using a supported PHP version, you will see the following message:
However, you will receive a warning if your website is not compatible with your current PHP version. Click the Change button to update your PHP version to a supported one.
Alternatively, test your website with the new PHP version manually on a local development server. This option lets you check your site’s compatibility with the new PHP version without affecting the live one.

You may get PHP error messages or warnings even when your site works fine. Unfortunately, these alerts may indicate that your site code may not work with a different PHP version.
If you host your website on Hostinger, you can disable PHP error messages via hPanel. However, you shouldn’t ignore them, especially if your site encounters issues.
These error messages help determine PHP problems, allowing you to fix them quickly. In case of incompatibility, resolve the error by:
The simplest way to change your system-wide version of PHP is via your hosting control panel. Aside from switching to different PHP versions, it lets you configure PHP extensions and options. At Hostinger, we use hPanel.
hPanel supports up to PHP 8.2 and will update its support each time a new PHP version is launched. Although we will use hPanel in this tutorial, the following steps should be similar for other hosting control panels like cPanel:
You can change the PHP version for a specific folder of a subdomain by editing the .htaccess file. This method allows you to use multiple PHP versions on the same account.
In the following tutorial, we will install PHP 8.1 for a subdomain via hPanel:



<FilesMatch ".(php4|php5|php3|php2|php|phtml)$"> SetHandler application/x-lsphp81 </FilesMatch>

Optionally, create a phpinfo.php file to check your PHP settings and version.
To use multiple PHP versions, repeat the steps above for each subdomain or folder.
However, we don’t recommend modifying the .htaccess file to change your PHP version. This method doesn’t include PHP extensions and options, which may affect your site’s functionality.
If you choose this method, consider manually configuring the PHP modules and options by editing the php.ini file.
PHP is a server-side scripting language used for web development. Popular CMSs like WordPress and Joomla are based on PHP.
You may want to switch to a different PHP version for various reasons, such as improving your website’s performance and fixing compatibility issues.
However, changing the PHP version can affect your website’s functionality. Consider the following before switching your PHP version:
You can use hPanel or other hosting control panels to change your hosting account’s PHP version. Alternatively, change the PHP version for a specific folder or subdomain by adding a command to your .htaccess file.
This section will answer some of the most commonly asked questions about changing your PHP version. If your question remains unanswered, leave it in the comments section below.
Use your hosting control panel to check the PHP version installed on your site. Since the steps vary across different control panels, always refer to the user manual.
For hPanel users,click the Manage button next to a domain → Advanced → PHP info. If you have a cPanel account, go to Software → Select PHP version.
We recommend using the latest PHP stable release that compatible with WordPress to ensure your site runs properly. At the time of writing, it is PHP 8.3.
Since PHP updates frequently, always check the PHP download page before switching.
Yes, you can downgrade your site’s PHP to any version. But note that downgrading PHP to an older version may cause errors.
The best way to downgrade your PHP version is via your hosting control panel. If you use hPanel, follow our article on downgrading your PHP version.