1. Knowledge Base
  2. >
  3. Results
  4. >
  5. What Version of PHP Are You Using?

What Version of PHP Are You Using?

 

The default version of PHP on your server depends on your hosting type. Please see the chart below for a breakdown of versions and availability by hosting type. The following information is covered in this article:

Please note: Secondary installs of PHP — any installation of PHP that is outside what is managed via cPanel — are free.

What Version of PHP am I Using?

With a variety of available PHP versions, it can be difficult to identify which version your site is taking advantage of. This can be even more challenging to determine given that PHP versions are defined in the .htaccess File, meaning that subfolders can inherit the versions their parent directories are using.

The easiest way to be certain what version of PHP a folder is using is to create a phpinfo.php file in that directory and navigate to it. The top of the phpinfo page will tell you what version of PHP is being referenced by that directory.

The following article will provide instructions for how to create and visit a phpinfo.php file:

How Do I Change My PHP Version?

HostGator provides a PHP Configuration plugin on our Shared and Reseller server cPanels that allows setting the PHP version for specific directories and domains. Please see the following link for information on using this plugin:

Note: Customers on a VPS or Dedicated server will only have one version of PHP installed by default. To use alternate versions of PHP, please contact us to Support with your request.

What Versions of PHP are Available?

We highly recommend using the most up-to-date version available that is compatible with your scripts. Many of our servers have installations of legacy PHP versions, which will not be guaranteed on current or future servers. The chart below shows the versions of PHP installed on newly provisioned servers.

All shared servers are updated with the versions of PHP listed below, even legacy servers, though a legacy version of PHP may be the default. A VPS or Dedicated server will have the version of PHP which was default at the time of provisioning, and must request an upgrade as a PHP version change can cause errors, and we will not do this automatically.

PHP versions 5.4 and earlier, available on many legacy servers, are deprecated software and no longer receive security updates from the PHP development team. As such, we recommend that you prepare your scripts for PHP 5.6 or higher.
Key

Default
This is the default version on newly provisioned servers. Some legacy servers may use an older version as default.

Configuration Plugin
You can use this version with a small change using our PHP configuration plugin.

.htaccess File
You can use this version with adding code to the .htaccess file.

Upon
Request
You can request this version of PHP by contacting us via phone or Live Chat

Not Available
This PHP version is not available for this hosting plan.

Not Officially
Supported
Not officially supported, but you can request it.  Use at your own risk.

Linux

Hosting TypePHP 7.0.xPHP 7.1.xPHP 7.2.xPHP 7.3.x
Shared Hosting
Configuration Plugin

Configuration Plugin

Configuration Plugin
or
.htaccess File

Configuration Plugin
or
.htaccess File
Cloud Sites
Configuration Plugin

Configuration Plugin

Configuration Plugin
or
.htaccess File

Configuration Plugin
or
.htaccess File
Optimized WordPress
Upon
Request

Upon
Request

Default

Upon
Request
Reseller Hosting
Configuration Plugin

Configuration Plugin

Configuration Plugin
or
.htaccess File

Configuration Plugin
or
.htaccess File
VPS Hosting with cPanel
Upon
Request

Configuration Plugin

Default

Upon
Request
VPS with VZ OnlySince this is a bare-bones installation,
PHP is not installed by default,
but you can install any version you like.
Linux Dedicated Servers
Upon
Request

Configuration Plugin

Upon
Request

Upon
Request
Note: The method below will only work if that version of PHP is available on your specific server. If you would like to know if your desired version of PHP is available on your server, please contact us via phone or Live Chat.
 
Updating PHP with the .htaccess file

If you're trying to update to PHP 7.2 or newer and it's not available in the configuration plugin, you can add the following to the .htaccess file for your site.
 

PHP 7.2

<IfModule mime_module>
<AddHandler application/x-httpd-ea-php72 .php .php5 .phtml>
</IfModule>
	
PHP 7.3

<IfModule mime_module>
<AddHandler application/x-httpd-ea-php73 .php .php5 .phtml>
</IfModule>
	

Windows Hosting

Hosting TypePHP 7.0.xPHP 7.1.xPHP 7.2.x
Windows Shared Hosting
Default

Not Available

Not Available
Windows Dedicated Servers
Default

Upon Request

Upon Request