{"id":362,"date":"2022-06-13T10:31:09","date_gmt":"2022-06-13T10:31:09","guid":{"rendered":"https:\/\/websitebuddy.in\/blog\/?p=362"},"modified":"2025-04-14T11:34:18","modified_gmt":"2025-04-14T11:34:18","slug":"how-to-change-php-version-from-capnel-easily","status":"publish","type":"post","link":"https:\/\/websitebuddy.in\/blog\/how-to-change-php-version-from-capnel-easily\/","title":{"rendered":"In 5 min how to change PHP version from capnel"},"content":{"rendered":"<p>Your Hosting at <a href=\"https:\/\/websitebuddy.in\/\">Websitebuddy<\/a> supports multiple versions of PHP. To change PHP version used for your account, follow these steps:<\/p>\n<p><strong>Step 1.<\/strong>\u00a0 <a href=\"https:\/\/websitebuddy.in\/blog\/how-to-login-to-cpanel\/\">Log in to cPanel<\/a>.<\/p>\n<blockquote><p>If you do not know how to log in to your cPanel account, please see\u00a0<a href=\"https:\/\/websitebuddy.in\/blog\/?p=368&amp;preview=true\">this article<\/a>.<\/p><\/blockquote>\n<p><strong>Step 2.<\/strong> In the <span class=\"UI\">SOFTWARE<\/span>\u00a0section of the cPanel home screen, click\u00a0<strong><span class=\"UI\">Select PHP Version<\/span><\/strong>:<\/p>\n<p><img data-opt-id=912409600  fetchpriority=\"high\" decoding=\"async\" class=\"alignnone wp-image-1249 size-full\" src=\"https:\/\/mliprmbtyown.i.optimole.com\/w:auto\/h:auto\/q:mauto\/f:best\/https:\/\/websitebuddy.in\/blog\/wp-content\/uploads\/2022\/06\/1_1.png\" alt=\"\" width=\"959\" height=\"327\" srcset=\"https:\/\/mliprmbtyown.i.optimole.com\/w:959\/h:327\/q:mauto\/f:best\/https:\/\/websitebuddy.in\/blog\/wp-content\/uploads\/2022\/06\/1_1.png 959w, https:\/\/mliprmbtyown.i.optimole.com\/w:300\/h:102\/q:mauto\/f:best\/https:\/\/websitebuddy.in\/blog\/wp-content\/uploads\/2022\/06\/1_1.png 300w, https:\/\/mliprmbtyown.i.optimole.com\/w:768\/h:262\/q:mauto\/f:best\/https:\/\/websitebuddy.in\/blog\/wp-content\/uploads\/2022\/06\/1_1.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/p>\n<p><strong>Step 3.<\/strong> cPanel displays the current version. To change php version, in the Current PHP Version list box, select the version that you want to use.<br \/>\n<strong>Step 4.<\/strong> Click on <strong>Set as current<\/strong>. The new PHP version takes effect immediately.<\/p>\n<p><img data-opt-id=728614  fetchpriority=\"high\" decoding=\"async\" class=\"alignnone wp-image-1252 size-full\" src=\"https:\/\/mliprmbtyown.i.optimole.com\/w:auto\/h:auto\/q:mauto\/f:best\/https:\/\/websitebuddy.in\/blog\/wp-content\/uploads\/2022\/06\/2_2.png\" alt=\"\" width=\"693\" height=\"316\" srcset=\"https:\/\/mliprmbtyown.i.optimole.com\/w:693\/h:316\/q:mauto\/f:best\/https:\/\/websitebuddy.in\/blog\/wp-content\/uploads\/2022\/06\/2_2.png 693w, https:\/\/mliprmbtyown.i.optimole.com\/w:300\/h:137\/q:mauto\/f:best\/https:\/\/websitebuddy.in\/blog\/wp-content\/uploads\/2022\/06\/2_2.png 300w\" sizes=\"(max-width: 693px) 100vw, 693px\" \/><\/p>\n<h3>Why You Should Update \/ Change PHP version:<\/h3>\n<p><strong>Better security: <\/strong>The most important reason to update your PHP is for security. As previously stated, security fixes for earlier PHP versions are no longer available. That implies known vulnerabilities aren&#8217;t patched in that version, leaving your site vulnerable to hackers.<\/p>\n<p><strong>Site Speed:<\/strong> Newer PHP versions will execute code more quickly, resulting in faster page load times. Faster website load timings lead to better user experience as well as <a href=\"https:\/\/zaclab.com\/seo-services\/\" target=\"_blank\" rel=\"noopener\">positive SEO<\/a> results. Site speed is a ranking element in SEO. Improve site speed if you want to be on the first page of Google search results.<\/p>\n<p><strong>Ongoing Support: <\/strong>You are safe from the newest known vulnerabilities if you are using the most recent PHP versions. When security flaws in PHP are discovered, people work togather to patch them.<\/p>\n<h3><b>Change PHP version for addon domain<\/b><\/h3>\n<p>Sometimes your website may need to use a different version from the one assigned to your whole cPanel account.<\/p>\n<p>To set a different version for an addon domain, you need to add a special code to your .htaccess file. To do this, follow the steps below.<\/p>\n<p>1. Find the .htaccess file for the addon domain in question. The steps for how to find it can be located\u00a0<a href=\"https:\/\/www.namecheap.com\/support\/knowledgebase\/article.aspx\/9410\/29\/how-to-set-up-rules-and-redirects-in-htaccess#locate\" target=\"_blank\" rel=\"noopener\">here<\/a>.<\/p>\n<p>2. Add the following line to your .htaccess file:<\/p>\n<pre class=\"prettyprint\">&lt;FilesMatch \".(?:html|php)$\"&gt;\r\nSetHandler application\/x-lsphpXX\r\n&lt;\/FilesMatch&gt;<\/pre>\n<p>For servers with LiteSpeed the code should be the following:<\/p>\n<pre class=\"prettyprint\">&lt;FilesMatch \".(?:html|php)$\"&gt;\r\nSetHandler application\/x-httpd-alt-phpXX\r\n&lt;\/FilesMatch&gt;\r\n<\/pre>\n<p>where <i>XX\u00a0<\/i>is the PHP version you wish to set. It can be 52, 53, 54, 55, 56, 70, 71,72, 73, 74, 80 or 81.<\/p>\n<p>&nbsp;<\/p>\n<div>3. Click \u201cSave changes\u201d.<\/div>\n<div><\/div>\n<div>\n<p><b>NOTE:<\/b> When a different version is set for the addon domain, there are no PHP extensions enabled by default. To make a website work correctly, you will need to upload a php.ini file to the folder of the addon domain. You can check\u00a0<a href=\"#\" target=\"_blank\" rel=\"noopener\">this article<\/a>\u00a0(see point 6) to help you with uploading files to the hosting account.<\/p>\n<p>You need to download the php.ini file for different PHP versions from the\u00a0<b>Attachments\u00a0<\/b>section at the end of this guide. Do not forget to rename the file to php.ini once it is uploaded to the hosting account.<\/p>\n<p>Alternatively, you can run the command below via SSH:<\/p>\n<pre class=\"prettyprint\">cp \/opt\/alt\/default_php_ini\/phpXX.ini \/home\/cPanel_username\/path_to_the_folder\/php.ini<\/pre>\n<ul>\n<li><i>XX <\/i>is PHP version you wish to set (it can be 52, 53, 54, 55, 56, 70, 71, 72, 73, 74, 80 or 81),<\/li>\n<li><i>cPanel_username<\/i>\u00a0should be replaced with your actual cPanel username, and<\/li>\n<li><i>path_to_the_folder<\/i>\u00a0is a path to the folder of the addon domain.<\/li>\n<\/ul>\n<p>For example:<\/p>\n<\/div>\n<div>\n<div>You can find details on how to access a hosting account via SSH\u00a0<a href=\"#\" target=\"_blank\" rel=\"noopener\">here<\/a>.<br \/>\nThe process is similar if you wish to set a different PHP version for a subdomain.<\/div>\n<div>When php.ini is created, make sure to add <a href=\"#\" target=\"_blank\" rel=\"noopener\">lsapi_phpini<\/a>\u00a0directive to .htaccess to activate the file.<\/div>\n<div><\/div>\n<div>That&#8217;s it!<\/div>\n<div><\/div>\n<\/div>\n<div>You May Also Like : <a href=\"https:\/\/websitebuddy.in\/blog\/problems-with-free-hosting-you-cannot-ignore\/\">Problems with Free Hosting you cannot ignore.<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Your Hosting at Websitebuddy supports multiple versions of PHP. To change PHP version used for your account, follow these steps: Step 1.\u00a0 Log in to cPanel. If you do not know how to log in to your cPanel account, please see\u00a0this article. Step 2. In the SOFTWARE\u00a0section of the cPanel home screen, click\u00a0Select PHP Version: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":615,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[10],"tags":[],"class_list":["post-362","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-hosting"],"_links":{"self":[{"href":"https:\/\/websitebuddy.in\/blog\/wp-json\/wp\/v2\/posts\/362","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/websitebuddy.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/websitebuddy.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/websitebuddy.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/websitebuddy.in\/blog\/wp-json\/wp\/v2\/comments?post=362"}],"version-history":[{"count":4,"href":"https:\/\/websitebuddy.in\/blog\/wp-json\/wp\/v2\/posts\/362\/revisions"}],"predecessor-version":[{"id":1411,"href":"https:\/\/websitebuddy.in\/blog\/wp-json\/wp\/v2\/posts\/362\/revisions\/1411"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/websitebuddy.in\/blog\/wp-json\/wp\/v2\/media\/615"}],"wp:attachment":[{"href":"https:\/\/websitebuddy.in\/blog\/wp-json\/wp\/v2\/media?parent=362"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/websitebuddy.in\/blog\/wp-json\/wp\/v2\/categories?post=362"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/websitebuddy.in\/blog\/wp-json\/wp\/v2\/tags?post=362"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}