{"id":536,"date":"2016-06-01T00:00:00","date_gmt":"2016-06-01T00:00:00","guid":{"rendered":"http:\/\/blog.hostinger.io\/hostinger-tutorials\/%category\/cpanelhow-to-change-your-php-version-in-cpanel\/"},"modified":"2026-03-10T10:07:51","modified_gmt":"2026-03-10T10:07:51","slug":"how-to-change-your-php-version","status":"publish","type":"post","link":"\/my\/tutorials\/how-to-change-your-php-version","title":{"rendered":"How to change the PHP version of a website + things to consider before updating"},"content":{"rendered":"<?xml encoding=\"utf-8\" ?><p>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.<\/p><p>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&rsquo;s functionality.<\/p><p>This article will explain why and how to change your site&rsquo;s PHP version. We will also list the prerequisites and answer commonly asked questions about changing the PHP version.<\/p><p>\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-why-change-php-version-of-your-site\">Why Change PHP Version of Your Site<\/h2><p>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.<\/p><p>A PHP upgrade can bring many benefits to your site, namely:<\/p><ul class=\"wp-block-list\">\n<li><strong>Increased security<\/strong>. Due to its popularity, many <a href=\"https:\/\/cyware.com\/news\/php-abused-for-web-skimming-attacks-a326087d\" target=\"_blank\" rel=\"noopener\">cybercriminals often exploit PHP<\/a> to attack a website. Updating PHP applies the newest security patch, protecting your site.<\/li>\n\n\n\n<li><strong>Performance boost<\/strong>. The newer PHP version is faster and more efficient. According to WordPress, updating PHP can improve your site&rsquo;s speed by up to <a href=\"https:\/\/wordpress.org\/support\/update-php\/\" target=\"_blank\" rel=\"noopener\">400%<\/a>.<\/li>\n\n\n\n<li><strong>New features<\/strong>. A major PHP update usually adds new features. For instance, <a href=\"https:\/\/www.php.net\/manual\/en\/migration80.new-features.php\" target=\"_blank\" rel=\"noopener\">PHP version 8&rsquo;s new features<\/a> include named arguments, union types, and match expression features.<\/li>\n\n\n\n<li><strong>Improved functionality<\/strong>. Updating your PHP version fixes bugs that may harm your site&rsquo;s functionality. It also lets you run your updated site code properly.<\/li>\n<\/ul><p>Meanwhile, you may want to downgrade PHP to an earlier version to fix an incompatibility issue. Sometimes, newer PHP versions can&rsquo;t properly run older plugins, themes, or site codes.<\/p><h2 class=\"wp-block-heading\" id=\"h-what-to-consider-before-changing-the-php-version\">What to Consider Before Changing the PHP Version<\/h2><p>Before switching to a different PHP version, consider the following prerequisites to ensure your site works normally.<\/p><h3 class=\"wp-block-heading\" id=\"h-update-cms-to-the-newest-version\">Update CMS to the Newest Version<\/h3><p>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&rsquo;s functionality.<\/p><p>The steps to check your CMS version may vary. To <a href=\"\/my\/tutorials\/how-to-check-which-version-of-wordpress-you-are-using\">check your current WordPress version<\/a>, log in to your site&rsquo;s <strong>wp-admin<\/strong> page and navigate to the sidebar &rarr; <strong>Dashboard &rarr; Updates<\/strong>.<\/p><figure class=\"wp-block-image aligncenter size-large\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2016\/06\/wordpress-updates-menu.png\"><img decoding=\"async\" width=\"1024\" height=\"276\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2016\/06\/wordpress-updates-menu-1024x276.png\" alt=\"The Updates button on the WordPress dashboard sidebar\n\" class=\"wp-image-73146\" srcset=\"https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/06\/wordpress-updates-menu.png 1024w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/06\/wordpress-updates-menu-300x81.png 300w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/06\/wordpress-updates-menu-150x40.png 150w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/06\/wordpress-updates-menu-768x207.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><p>WordPress will display the currently active version and the newest stable release. If your WordPress is up-to-date, it will say, &ldquo;<strong>You have the latest version of WordPress.<\/strong>&rdquo;<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/02\/wordpress-dashboard-updates.png\"><img decoding=\"async\" width=\"1024\" height=\"464\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/02\/wordpress-dashboard-updates-1024x464.png\" alt='The \"You have the latest version of WordPress.\" message on the WordPress dashboard' class=\"wp-image-104239\" srcset=\"https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/02\/wordpress-dashboard-updates-1024x464.png 1024w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/02\/wordpress-dashboard-updates-300x136.png 300w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/02\/wordpress-dashboard-updates-150x68.png 150w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/02\/wordpress-dashboard-updates-768x348.png 768w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/02\/wordpress-dashboard-updates.png 1291w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div><p>Otherwise, it says, &ldquo;<strong>An updated version of WordPress is available.<\/strong>&rdquo; Simply press the <strong>Update Now<\/strong> button to download and install the latest WordPress version.<\/p><h3 class=\"wp-block-heading\" id=\"h-make-sure-the-site-code-is-up-to-date\">Make Sure the Site Code Is Up-To-Date<\/h3><p>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.<\/p><p>To ensure your site works well, update its code, themes, and plugins before upgrading PHP.<\/p><p>There are different ways to check whether your website is compatible with a specific version of PHP. For instance, you can use Hostinger&rsquo;s <strong>WordPress and PHP compatibility checker<\/strong>. This tool examines your site&rsquo;s core and current PHP version, advising a switch to a compatible version if necessary.<\/p><p>To use the compatibility checker, access your hPanel dashboard and navigate to <strong>WordPress &rarr; Overview<\/strong>, and locate the <strong>PHP Version<\/strong> section. If you&rsquo;re using a supported PHP version, you will see the following message:<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/02\/hpanel-wordpress-overview-php-version-highlighted.png\"><img decoding=\"async\" width=\"485\" height=\"721\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/02\/hpanel-wordpress-overview-php-version-highlighted.png\" alt=\"The PHP Version in hPanel shows a compatible version of PHP\" class=\"wp-image-104241\" srcset=\"https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/02\/hpanel-wordpress-overview-php-version-highlighted.png 485w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/02\/hpanel-wordpress-overview-php-version-highlighted-202x300.png 202w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/02\/hpanel-wordpress-overview-php-version-highlighted-101x150.png 101w\" sizes=\"(max-width: 485px) 100vw, 485px\" \/><\/a><\/figure><\/div><p>However, you will receive a warning if your website is not compatible with your current PHP version. Click the <strong>Change<\/strong> button to update your PHP version to a supported one.<\/p><p>Alternatively, test your website with the new PHP version manually on a local development server. This option lets you check your site&rsquo;s compatibility with the new PHP version without affecting the live one.<\/p><?xml encoding=\"utf-8\" ?><figure class=\"wp-block-image size-full\"><a href=\"\/my\/web-hosting\"><img decoding=\"async\" width=\"1024\" height=\"300\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/11\/Web-hosting_in-text-banner.png\" alt=\"Hostinger web hosting banner\" class=\"wp-image-98604\" srcset=\"https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2023\/11\/Web-hosting_in-text-banner.png 1024w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2023\/11\/Web-hosting_in-text-banner-300x88.png 300w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2023\/11\/Web-hosting_in-text-banner-150x44.png 150w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2023\/11\/Web-hosting_in-text-banner-768x225.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><h3 class=\"wp-block-heading\" id=\"h-resolve-php-errors-and-warnings\">Resolve PHP Errors and Warnings<\/h3><p>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.<\/p><p>If you <a href=\"\/my\/web-hosting\">host your website on Hostinger<\/a>, you can <a href=\"https:\/\/support.hostinger.com\/en\/articles\/1583197-how-to-turn-off-php-error-messages-in-hpanel\" target=\"_blank\" rel=\"noopener\">disable PHP error messages via hPanel<\/a>. However, you shouldn&rsquo;t ignore them, especially if your site encounters issues.<\/p><p>These error messages help determine PHP problems, allowing you to fix them quickly. In case of incompatibility, resolve the error by:<\/p><ul class=\"wp-block-list\">\n<li>Disable and enable themes and plugins<\/li>\n\n\n\n<li>Enable the default theme<\/li>\n\n\n\n<li>Update the site code, plugins, and themes<\/li>\n\n\n\n<li>Use the default <strong>.htaccess file<\/strong><\/li>\n<\/ul><h2 class=\"wp-block-heading\" id=\"h-how-to-change-php-version-in-hpanel\">How to Change PHP Version in hPanel<\/h2><p>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<strong> <\/strong>lets you configure PHP extensions and options. At Hostinger, we use <a href=\"\/support\/1583483-comprehensive-guide-to-hpanel-at-hostinger\/\">hPanel<\/a>.<\/p><p>hPanel supports up to <strong>PHP 8.2<\/strong> and will update its support each time a new PHP version is launched. Although we will use <strong>hPanel<\/strong> in this tutorial, the following steps should be similar for other hosting control panels like <strong>cPanel<\/strong>:<\/p><ol class=\"wp-block-list\">\n<li>Log in to <strong>hPanel<\/strong> and click <strong>Hosting <\/strong>on top of the homepage.<\/li>\n<\/ol><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2016\/06\/hosting-menu-in-hpanel-homepage.png\"><img decoding=\"async\" width=\"1024\" height=\"396\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2016\/06\/hosting-menu-in-hpanel-homepage-1024x396.png\" alt=\"Hosting menu in hPanel homepage\" class=\"wp-image-73148\" srcset=\"https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/06\/hosting-menu-in-hpanel-homepage.png 1024w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/06\/hosting-menu-in-hpanel-homepage-300x116.png 300w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/06\/hosting-menu-in-hpanel-homepage-150x58.png 150w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/06\/hosting-menu-in-hpanel-homepage-768x297.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div><ol start=\"2\" class=\"wp-block-list\">\n<li>Click the <strong>Manage <\/strong>button next to your domain name.<\/li>\n<\/ol><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2016\/06\/manage-a-domain-in-hpanel.png\"><img decoding=\"async\" width=\"1024\" height=\"383\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2016\/06\/manage-a-domain-in-hpanel-1024x383.png\" alt=\"The Manage button next to the domain name on hPanel's Hosting screen\" class=\"wp-image-73149\" srcset=\"https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/06\/manage-a-domain-in-hpanel.png 1024w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/06\/manage-a-domain-in-hpanel-300x112.png 300w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/06\/manage-a-domain-in-hpanel-150x56.png 150w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/06\/manage-a-domain-in-hpanel-768x287.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div><ol start=\"3\" class=\"wp-block-list\">\n<li>On the sidebar, go to <strong>Advanced<\/strong> &rarr; <strong>PHP configuration<\/strong>.<\/li>\n<\/ol><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-advanced-phpconfiguration-highlight.png\"><img decoding=\"async\" width=\"1024\" height=\"300\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-advanced-phpconfiguration-highlight-1024x300.png\" alt=\"PHP configuration menu in hPanel\" class=\"wp-image-79455\" srcset=\"https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2023\/03\/hpanel-advanced-phpconfiguration-highlight.png 1024w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2023\/03\/hpanel-advanced-phpconfiguration-highlight-300x88.png 300w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2023\/03\/hpanel-advanced-phpconfiguration-highlight-150x44.png 150w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2023\/03\/hpanel-advanced-phpconfiguration-highlight-768x225.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div><ol start=\"4\" class=\"wp-block-list\">\n<li>Select the <strong>PHP version<\/strong> you want to use. By default, it only shows supported versions, but you can check <strong>Show no longer supported PHP versions<\/strong> to display older ones.<\/li>\n<\/ol><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/02\/hpanel-websites-php-configuration.png\"><img decoding=\"async\" width=\"1024\" height=\"604\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/02\/hpanel-websites-php-configuration-1024x604.png\" alt=\"The PHP version tab in the PHP Configuration screen on hPanel\" class=\"wp-image-104242\" srcset=\"https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/02\/hpanel-websites-php-configuration-1024x604.png 1024w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/02\/hpanel-websites-php-configuration-300x177.png 300w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/02\/hpanel-websites-php-configuration-150x88.png 150w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/02\/hpanel-websites-php-configuration-768x453.png 768w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/02\/hpanel-websites-php-configuration.png 1295w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div><ol start=\"5\" class=\"wp-block-list\">\n<li>Click <strong>Update <\/strong>to save the changes.<\/li>\n<\/ol><h2 class=\"wp-block-heading\" id=\"h-how-to-change-php-version-for-a-specific-folder-or-a-subdomain\">How to Change PHP Version for a Specific Folder or a Subdomain<\/h2><p>You can change the PHP version for a specific folder of a subdomain by editing the <strong>.htaccess<\/strong> file. This method allows you to use multiple PHP versions on the same account.<\/p><p>In the following tutorial, we will install<strong> PHP 8.1<\/strong> for a subdomain via <strong>hPanel<\/strong>:<\/p><ol class=\"wp-block-list\">\n<li>Log in to your <strong>hPanel <\/strong>and select <strong>Hosting<\/strong>.<\/li>\n\n\n\n<li>Click <strong>Manage <\/strong>next to your desired domain.<\/li>\n\n\n\n<li>Go to <strong>Files <\/strong>&rarr; <strong>File Manager<\/strong>.<\/li>\n<\/ol><figure class=\"wp-block-image aligncenter size-large\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2016\/06\/file-manager-menu-in-hpanel.png\"><img decoding=\"async\" width=\"1024\" height=\"497\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2016\/06\/file-manager-menu-in-hpanel-1024x497.png\" alt=\"File Manager menu in hPanel\n\" class=\"wp-image-73153\" srcset=\"https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/06\/file-manager-menu-in-hpanel.png 1024w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/06\/file-manager-menu-in-hpanel-300x145.png 300w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/06\/file-manager-menu-in-hpanel-150x73.png 150w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/06\/file-manager-menu-in-hpanel-768x372.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><ol start=\"4\" class=\"wp-block-list\">\n<li>Access the folder whose PHP version you want to change. To edit a subdomain, go to <strong>public_html &rarr; yoursubdomain <\/strong>folder.<\/li>\n<\/ol><figure class=\"wp-block-image aligncenter size-large\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2016\/06\/opening-a-subdomain-folder-in-hpanel-file-manager.png\"><img decoding=\"async\" width=\"1024\" height=\"505\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2016\/06\/opening-a-subdomain-folder-in-hpanel-file-manager-1024x505.png\" alt=\"The subdomain folder in File Manager on hPanel\n\" class=\"wp-image-73155\" srcset=\"https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/06\/opening-a-subdomain-folder-in-hpanel-file-manager.png 1024w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/06\/opening-a-subdomain-folder-in-hpanel-file-manager-300x148.png 300w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/06\/opening-a-subdomain-folder-in-hpanel-file-manager-150x74.png 150w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/06\/opening-a-subdomain-folder-in-hpanel-file-manager-768x379.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><ol start=\"5\" class=\"wp-block-list\">\n<li>Double-click on the <strong>.htaccess <\/strong>file. If it doesn&rsquo;t exist, <a href=\"\/my\/tutorials\/locate-and-create-htaccess\">create a new .htaccess file<\/a>.<\/li>\n<\/ol><figure class=\"wp-block-image aligncenter size-large\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2016\/06\/editing-.htaccess-in-hpanel.png\"><img decoding=\"async\" width=\"1024\" height=\"426\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2016\/06\/editing-.htaccess-in-hpanel-1024x426.png\" alt=\"The .htaccess file in the subdomain folder in hPanel's file manager\n\" class=\"wp-image-73154\" srcset=\"https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/06\/editing-.htaccess-in-hpanel.png 1024w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/06\/editing-.htaccess-in-hpanel-300x125.png 300w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/06\/editing-.htaccess-in-hpanel-150x62.png 150w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/06\/editing-.htaccess-in-hpanel-768x320.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><ol start=\"6\" class=\"wp-block-list\">\n<li>Copy and paste the following command to the beginning of the <strong>.htaccess <\/strong>file to install<strong> PHP 8.1<\/strong>. To install a different PHP version, change <strong>81 <\/strong>with your desired version number. Read our <a href=\"https:\/\/support.hostinger.com\/en\/articles\/4047803-how-to-change-php-version-for-subfolders-or-subdomains\" target=\"_blank\" rel=\"noopener\">PHP version change<\/a> article to view other useful commands.<\/li>\n<\/ol><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;FilesMatch \".(php4|php5|php3|php2|php|phtml)$\"&gt;\nSetHandler application\/x-lsphp81\n&lt;\/FilesMatch&gt;<\/pre><ol start=\"7\" class=\"wp-block-list\">\n<li>Click the <strong>disk icon<\/strong> on the top right corner to save the changes.<\/li>\n<\/ol><figure class=\"wp-block-image aligncenter size-large\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2016\/06\/saving-changes-to-the-.htaccess-file.png\"><img decoding=\"async\" width=\"1024\" height=\"192\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2016\/06\/saving-changes-to-the-.htaccess-file-1024x192.png\" alt=\"The disk icon for saving the .htaccess file changes\n\" class=\"wp-image-73156\" srcset=\"https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/06\/saving-changes-to-the-.htaccess-file-1024x192.png 1024w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/06\/saving-changes-to-the-.htaccess-file-300x56.png 300w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/06\/saving-changes-to-the-.htaccess-file-150x28.png 150w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/06\/saving-changes-to-the-.htaccess-file-768x144.png 768w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/06\/saving-changes-to-the-.htaccess-file.png 1460w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><p>Optionally, <a href=\"https:\/\/support.hostinger.com\/en\/articles\/5920192-how-to-check-my-php-version\" target=\"_blank\" rel=\"noopener\">create a phpinfo.php<\/a><strong> <\/strong>file to check your PHP settings and version.<\/p><p>To use multiple PHP versions, repeat the steps above for each subdomain or folder.<\/p><p>However, we don&rsquo;t recommend modifying the <strong>.htaccess<\/strong> file to change your PHP version. This method doesn&rsquo;t include PHP extensions and options, which may affect your site&rsquo;s functionality.<\/p><p>If you choose this method, consider manually configuring the PHP modules and options by <a href=\"https:\/\/docs.bitnami.com\/aws\/apps\/dokuwiki\/configuration\/install-modules-php\/\" target=\"_blank\" rel=\"noopener\">editing the php.ini<strong> <\/strong>file<\/a>.<\/p><h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2><p>PHP is a server-side scripting language used for web development. Popular CMSs like WordPress and Joomla are based on PHP.<\/p><p>You may want to switch to a different PHP version for various reasons, such as improving your website&rsquo;s performance and fixing compatibility issues.<\/p><p>However, changing the PHP version can affect your website&rsquo;s functionality. Consider the following before switching your PHP version:<\/p><ul class=\"wp-block-list\">\n<li>Update your CMS to the newest version<\/li>\n\n\n\n<li>Renew your site code<\/li>\n\n\n\n<li>Resolve existing PHP errors or warnings<\/li>\n<\/ul><p>You can use <strong>hPanel <\/strong>or other hosting control panels<strong> <\/strong>to change your hosting account&rsquo;s PHP version. Alternatively, change the PHP version for a specific folder or subdomain by adding a command to your <strong>.htaccess <\/strong>file.<\/p><h2 class=\"wp-block-heading\" id=\"h-change-php-version-faq\">Change PHP Version FAQ<\/h2><p>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.<\/p><div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1671542707344\"><h3 class=\"schema-faq-question\">How to Check My PHP Version?<\/h3> <p class=\"schema-faq-answer\">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.<br><br>For <strong>hPanel <\/strong>users,click the <strong>Manage <\/strong>button next to a domain &rarr; <strong>Advanced<\/strong> &rarr;&nbsp; <strong>PHP info<\/strong>. If you have a <strong>cPanel <\/strong>account<strong>, <\/strong>go to Software &rarr; <strong>Select PHP version<\/strong>.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1671542732022\"><h3 class=\"schema-faq-question\">Which PHP Version Should I Use?<\/h3> <p class=\"schema-faq-answer\">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<strong> PHP 8.3<\/strong>.<br><br>Since PHP updates frequently, always check the <a href=\"https:\/\/www.php.net\/downloads.php\" target=\"_blank\" rel=\"noopener\">PHP download page<\/a> before switching.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1671542762673\"><h3 class=\"schema-faq-question\">Can I Downgrade My PHP Version?<\/h3> <p class=\"schema-faq-answer\">Yes, you can downgrade your site&rsquo;s PHP to any version. But note that downgrading PHP to an older version may cause errors.<br><br>The best way to downgrade your PHP version is via your hosting control panel. If you use <strong>hPanel<\/strong>, follow our article on <a href=\"https:\/\/support.hostinger.com\/en\/articles\/1575755-how-can-i-change-my-php-version\" target=\"_blank\" rel=\"noopener\">downgrading your PHP version.<\/a><\/p> <\/div> <\/div>\n","protected":false},"excerpt":{"rendered":"<p>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 [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/my\/tutorials\/how-to-change-your-php-version\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":24,"featured_media":127038,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"How to Change PHP Version of a Website Without Breaking It","rank_math_description":"Check out this article to learn how to change the PHP version for your website using hPanel, as well as why you should do so.","rank_math_focus_keyword":"change php version, change php version, updating php version, changing php version","footnotes":""},"categories":[22625],"tags":[],"class_list":["post-536","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technical-aspects"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/how-to-change-your-php-version","default":0},{"locale":"pt-BR","link":"https:\/\/www.hostinger.com\/br\/tutoriais\/atualizar-php-hostinger","default":0},{"locale":"fr-FR","link":"https:\/\/www.hostinger.com\/fr\/tutoriels\/changer-version-php","default":0},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/tutorial\/cara-mengganti-versi-php","default":0},{"locale":"en-UK","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/how-to-change-your-php-version","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/how-to-change-your-php-version","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/how-to-change-your-php-version","default":0},{"locale":"pt-PT","link":"https:\/\/www.hostinger.com\/pt\/tutoriais\/atualizar-php-hostinger","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/how-to-change-your-php-version","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/how-to-change-your-php-version","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/how-to-change-your-php-version","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/how-to-change-your-php-version","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/posts\/536","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/users\/24"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/comments?post=536"}],"version-history":[{"count":34,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/posts\/536\/revisions"}],"predecessor-version":[{"id":127037,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/posts\/536\/revisions\/127037"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/media\/127038"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/media?parent=536"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/categories?post=536"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/tags?post=536"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}