Frequently Asked Questions

Using .htaccess Files to Manage PHP File Extensions

Print this Article
Comment on this Article
Last Updated: September 1, 2011 10:06 AM

Your hosting account uses PHP files in the following way:

However, you can also change how your hosting account uses PHP files with a .htaccess file located in your root directory.

The following entries in a directory's .htaccess file designate PHP files to run under PHP 5 and PHP4 files to run under PHP 4.

AddHandler x-httpd-php5 .php
AddHandler x-httpd-php .php4

Hosting accounts should use the following entries for CGI:

AddHandler x-httpd-php5-cgi .php
AddHandler x-httpd-php-cgi .php4

Or, 4GH accounts can use these entries with FastCGI:

AddHandler x-httpd-php5 .php
AddHandler x-httpd-php .php4

If you want your 4GH account to use PHP 5.3.x instead of PHP 5.2.x, use the following entry:

AddHandler x-httpd-php5-3 .php

NOTE: We only offer PHP 5.3.x with fastcgi using fcgid.

Changes made to an existing .htaccess file will be seen immediately. When creating new .htaccess files or deleting existing .htaccess files, you might not see changes for up to an hour.

You can also change your hosting account's default PHP version through the Hosting Control Center. For more information, see Viewing or Changing Your PHP Language Version.