PHP is a scripting language that is used to design dynamic web pages. It is widely used all over the world for the generation of interactive web pages that can take in data from the users and display results to them in real time. It is necessary that your hosting company should support some of the latest versions of PHP 5. All types of hosting provided by HostGator support PHP versions 5.2 and 5.3.
Use phpinfo to find HostGator PHP version:
To determine which PHP version and settings your HostGator server is using follow the steps given below. The process will not take more than a minute:
- Log into your HostGator cpanel and scroll down to the folders sections.
- Open the public_html folder for your site, and create a new file named phpinfo.
- Insert the following code into this file:
- Go to your browser and open this web page:” http://yourdomain.com/phpinfo.php”, where you need to replace yourdomain.com by the actual name of your domain. For example if your site name is example.com then replace yourdomain.com with it.
- Phpinfo.php page will open in your browser. The page displays the HostGator PHP version at the top. You will also find the MySQL version and you can also verify php settings like safe_mode, memory_limit, etc.
With the small code for phpinfo page you can determine all the PHP settings of your site server.
How to upgrade to PHP 5.3?
HostGator servers can run both PHP 5.2 and 5.3. The default version for most HostGator servers is PHP 5.2.x but you have an option to change to 5.3 as well. For some accounts you need to create a file with a few lines of code and for other you need to send an email to firstname.lastname@example.org for an upgrade. Here are the details for all the HostGator account types:
Shared and Reseller Plans: PHP 5.3.5 is installed on all servers. To run PHP a handler has been added to Shared and Reseller accounts. To use the handler you need to create .htaccess file and insert the following code into it, and your server HostGator PHP version will be upgraded to 5.3.5.
Action application/x-hg-php53 /cgi-sys/php53
AddHandler application/x-hg-php53 .php
VPS server: To upgrade Linux VPS server to version 5.3 send an email to email@example.com and request for the installation of HostGator 5.3.5. Windows VPS servers are making use of PHP 5.3.5 as default. If your Windows VPS account is old then to request an upgrade send an email to firstname.lastname@example.org.
Dedicated Servers: For Linux dedicated server you need to send an email to email@example.com and request the recompilation of Apache to support newer versions of PHP. You need to send an email to request PHP 5.3.5 installation for Windows server too.
Choose the right HostGator PHP version:
Both PHP versions 5.2 and 5.3 are stable and will work fine with your site. PHP 5.3 has some additional features. Check the PHP official website for full list of PHP 5.2 and 5.3 features. When deciding which PHP version to use check the system requirements for the web application you want to use. For example different versions of Moodle require different PHP versions. Moodle is a web application which is used by instructors to create online learning sites. Moodle can be installed using QuickInstall or Fantastico. Moodle 2.0 needs a version higher than 5.2.8, which means it will work fine with HostGator PHP version default settings. While Moodle 2.1 needs support for PHP 5.3.x, so you need to turn on this PHP version on your server by following the steps described in last section.