• Follow me on:

Friday, April 26, 2019

How to change the PHP version on my website?

Recently I had a problem with a project.  I created a website using wordpress and upgraded the hosting server to latest version 7.2.  But other websites on this same hosting stop working.  These other websites were pretty old and created in PHP version 5.6.  It was showing HTTP Error 500.  In cPanel there is an option to upgrade PHP version.  But single PHP version is allowed for single cPanel.

Change the PHP version through cPanel


1. Login to cPanel. Scroll down to Software section and click on "Select PHP Version".  Next window select from the dropdown selection on top.


Change the PHP version using .htaccess file

Open .htaccess file through ftp or cpanel.  Some times its not visible in cPanel.  You can make them visible, view following article "How to show hidden files in cPanel?"

Edit .htaccess file in the root folder.  Add the following code and run.

AddHandler fcgid-script .php 
FCGIWrapper "/dh/cgi-system/php72.cgi" .php

Above code forces PHP to switch to 7.2 version.

Though this code was tested, if this doesn't work or causes any problem remove the lines and switch back to previous version. 


Share Your Solutions

How to show hidden files in cPanel

Very often we face this problem when few files specially (.) dot files are not visible in cPanel.  When we access them though FileZilla or WinSCP they are visible in the directory.  To make them visible go through following steps.

Login to cPanel, Click "File Manager" in Files section.

Complete directory will appear on the screen.  Click on Settings and check the option "Show hidden files" and Save 

Now you can see your hidden files listed in the same directory.



Share Your Solutions
All Rights Reserved Jaydharphics Click To Mail Me (+91 9564 5592 84)