HostGator.com » Support Portal



PHP 5.3

All our servers support (i.e. are capable of running) both PHP 5.2 and PHP 5.3 (with a few exceptions listed below). The default version is 5.2.x but you can follow the directions below to use PHP 5.3.x instead.

Exceptions: Newer VPS/Plesk installations have PHP 5.3 as the default, and do not support PHP 5.2. Windows Shared & Chilisoft ASP servers only support PHP 5.2.

Before switching, be aware of backwards compatibility issues with scripts: Older PHP coding may not be compatible with newer versions of PHP.

Please keep in mind: Using PHP 5.3 will break any sites requiring Zend or ioncube that were encoded with PHP 5.2. We recommend you check with the application developers to see if they have a 5.3 version available.

How to Enable

Follow the directions below for the hosting plan you have.

Shared and Reseller

We currently have 5.3.10 (or higher) installed on all servers. A handler for PHP 5.3 is added to our shared and reseller servers for those who wish to utilize it. In order to utilize this handler, you will need to add the following code to your .htaccess file:

# Use PHP 5.3
AddType application/x-httpd-php53 .php

You can edit your .htaccess file via FTP or through cPanel's File Manager, whatever is more convenient for you. For more information on how to do that, you may want to read our article on How to Edit Your .htaccess File.

Linux Dedicated Servers

Do not use the Handler code listed above. Instead, you must email support@hostgator.com and request Apache be recompiled to use PHP 5.3.

Windows Dedicated Servers

Do not use the Handler code listed above. Instead, you must email support@hostgator.com and request that PHP 5.3 be installed.

Windows Shared and Linux Chilisoft ASP

Windows Shared users can enable PHP 5.3 on their account by themselves. In order to use version 5.3 on Windows Shared, please see the instructions below.

  1. Go to the Websites & Domains tab.
  2. Select the domain that requires PHP5.3.
  3. Locate the Web Scripting & Statistics section.
  4. Check the PHP support box.
  5. Select Version 5.3 in the dropdown box.
  6. Click the OK button.

PHP 5.3 is not currently available on Linux Chilisoft ASP servers.

VPS with cPanel

Do not use the Handler code listed above. Instead, you must email support@hostgator.com and request that PHP 5.3 be installed.

VPS with Plesk

Newer VPS/Plesk installations are setup with PHP 5.3, however some older installations may have previous versions. If your VPS requires an upgrade to 5.3 please email support@hostgator.com to request this.

VPS with VZ only

VPS hosting accounts without cPanel or Plesk (that only have VZ Power Panel / Virtuozzo) do not have PHP installed by default. You can install any version of PHP that you want. Note: VPS hosting without cPanel or Plesk is considered unmanaged, and as such you would need to compile and install PHP yourself.


Things to Keep in Mind

If you are using a custom php.ini file that references PHP modules that are not available with PHP 5.3, your site may not work. Either remove the custom php.ini file (which will cause the server to use the default php.ini file for PHP 5.3), or create a php.ini file that is compatible with PHP 5.3.


Article Comments

Javier Martinez
Works like a charm!

Thank you very much for this update!!

Amir Meshkin
I have a vps level one account. And I just noticed that I have php 5.1.6 and I'd like php 5.3.

Do I have to install this myself and can anyone help me do that? Or will hostgator do it for me?

Do I need to upgrade to level 3 with cpanel if I want easy upgrades?

HostGator
Yes, you need to install the version you want. HostGator can do that for you, but we must charge for administrator time on an unmanaged plan.

Yes, if you upgrade to Lvl 3 with cPanel, then we would upgrade the PHP for you at no cost.

Jonathan
For anyone using the .htaccess change to enable php5.3, the method given in the forum for using a custom php.ini file stops working if you do this. You need to remove the
<IfModule mod_suphp.c>
line so now it looks like:
suPHP_ConfigPath /home/xxx
<Files php.ini>
order allow,deny
deny from all
</Files>

Then it will work.

Also, remember you will need to grab a new php.ini to customize, so where the old php.ini was at
/usr/local/lib/php.ini

you need to change it to
/opt/php53/lib/php.ini

so if you're using ssh, it would be (when in your home root folder)
cp /opt/php53/lib/php.ini ./

Michael
I am so happy for this... I have sold many accounts on this fact alone.

Mike
I have installations of WordPress and Drupal created with Fantastico on a site within my reseller account and when I try to add this code into the .htaccess, either at the subdomain or the domain level it breaks these instances. Is there a work around for this?

HostGator
Don't add this code to your sites. They may not be compatible with PHP 5.3.

If they are, please contact support so we can determine what is wrong.

Dan
If the AddType does not work try :
AddHandler application/x-httpd-php53 .php


Markus Staas
When adding AddType application/x-httpd-php53 .php

I get the following error message with my Fantastico Drupal 7 installation:

Fatal error: Class 'PDO' not found
Where is that class? And how do I enable it?

Cheers,

Markus

HostGator
That module is already installed on our shared servers.

However, this error likely means you should not be using PHP 5.3. Remove the php53 line and revert back to PHP 5.2.15. This is sufficient for Drupal 7.

Ruaan
worked perfectly for drupal 7.7 on basic plan .thanks host gator

Hugo Riveros
Works great on my baby plan! all I had to do was put these lines

# Use PHP 5.3
Action application/x-hg-php53 /cgi-sys/php53
AddHandler application/x-hg-php53 .php

in the .htaccess file, previously setting "show hide files" on on the cpanel file browser!

************

Funciona perfecto en mi plan baby! todo lo que hice fue añadir estas lineas

# Use PHP 5.3
Action application/x-hg-php53 /cgi-sys/php53
AddHandler application/x-hg-php53 .php

en el archivo .htaccess file, anteriormente habilitando la opción "mostrar archivos ocultos" en el explorador de archivos de cpanel!

Matthew
Hello,
Please update to 5.3 on the reseller plans. It is not a good solution to use .htaccess to deal with this.
Thanks!

HostGator
Unfortunately many popular scripts still use PHP 5.2 and would stop working if we made PHP 5.3 the default. That is why we have a dual environment where you can choose whether you want PHP 5.2 or PHP 5.3 In the future, as more and more popular scripts become compatible with PHP 5.3, we may change the default configuration. Some of our plans, like VPS with Plesk already come with PHP 5.3 as the default.

Walter Solano
O wow it does work :D
Hostgator is my beast hosting

Fahim Murshed
WOW

Thanks for this post. Its help me a lot. Joomla many extension need php5.3+.

HostGator really awesome and great Hosting provider in this world.

Wish you best of success.

Jorge Orellana
Works like a charm!

Thank you very much for it!!! :)

Samsodin Dianalan
awesome! thanks for great work!!!

HostGator
Thank you for your comments. Just a quick reminder that the comments on this page are not monitored by technical support staff, and that for support issues, it is best to contact us by live chat, phone or email so we can assist you right away.

Although comments are not monitored by technical support staff, they are moderated and read by technical writers. Comments will need to be approved by a moderator before appearing.

Our technical writers do read the comments periodically for the purposes of updating the articles, and do appreciate your feedback, suggestions and corrections to the articles themselves, as well as any suggestions or tips for readers of this article. However, support questions posted here are not guaranteed to be replied to in a timely manner or at all. For support issues, it is best to contact our support staff instead by live chat, email or phone.



Your comments help us keep the knowledge base updated. This is not a medium for support. If you have questions or need help, please contact us via email, phone or live chat for fast assistance.

Post Comment