Have your website PHP Contact Forms, Login Forms or similar applications stopped working after the recent PHP upgrade made by HostGator? If your answer is yes then today we will discuss the easiest way to counter this problem and fix all your PHP configuration issues. Hostgator often updates all your packages to keep your sites compatible with latest changes in server scripts and to offer better performance and security but sometimes such updates may cause your site applications to stop working. This problem is mostly encountered with Wordpress blogs and PHP forms on a site. This update is simply a change made to your site's .htaccess file. We will use the Plugin available at your HostGator Cpanel plugin called "PHP configuration Plugin" to view or modify your server's script configuration.
PS: For techy geeks who are curious how exactly this plugin does this, we will also discuss how to insert a manual handler in the .htaccess file.
The default version of PHP employed by Hostgator servers were all updated to PHP 5.4 on 5/7/2014, the prior version was PHP 5.2. If in case if your site uses an older script that is incompatible with a newer PHP version, we will simply revert the settings of your site back to PHP 5.2. To know how to do it please follow the steps below:
Modify PHP Version for Your Site
The PHP Configuration plugin in cPanel allows users on Shared and Reseller servers to easily enable a specific PHP version for a site without having to manually add a handler to the .htaccess file. To update the PHP version for a site:
- Log into cPanel.
- In the Advanced section, click on the PHP Configuration icon.
3. Now in the next screen Click public_html
4. Now you will see a list of all sites and subdomains that you created with Hostgator. This is basically your root directory. Click the drop down box and switch back to PHP 5.2.!
Note: If in future Hosgator updates the system to PHP 5.5 then you will need to switch back accordingly to PHP 5.4 instead of PHP 5.2.
5. Hit the update button and you are all done!
Your scripts are still not working?
If after the switch back your site continued not working then it means your particular domain or sub-domain is still using the newer version instead of the older one. Now you will need to further dig down to make one extra change.
Navigate to the directory for which you'd like to update the PHP version. For example in my case I will revert the PHP version to 5.2 for my Contact Page which did not work even after I applied the PHP 5.2 to root directory as discussed in previous STEP#4.
When this directory opens, you will observe that the HostGator has assigned it the No Custom PHP handler (Sys default) value which is PHP 5.4. See the screenshot below:
You will need to manually select the PHP 5.2 option.
Hit update and you are all set! This made our contact form work just fine!
How to add a Manual PHP Handler? [ For Geeks only! ]
- Open Notepad or a text file
- Paste the following code inside it
# Use PHP52 as default
AddHandler application/x-httpd-php52 .php
Simply replace php52 with the PHP version you wish to revert to. Make sure you don't add a decimal point in the version number. Write 5.2 as 52 simply.
3. Save them file with this file name and extension. .htaccess
4. Upload this file via Filezilla or any FTP client onto your desired directory. And you are all done!
This is the exact same way of adding a php Handler which the PHP Configuration Plugin uses.
Let me know if you needed any help. Peace and blessings buddies! :)
Need Quick Help within 24 Hours? ASK NOW
If you don't want to get yourself into Serious Technical Trouble while editing your Blog Template then just sit back and relax and let us do the Job for you at a fairly reasonable cost. Submit your order details by Clicking Here »