Support / KnowledgeBase

 
Search the KnowledgeBase Search

How can I specify the PHP version on the (gs) Grid-Service?

  • Applies to: (gs)

  • Difficulty: Easy

  • Time needed: 10 minutes

  • Tools needed: AccountCenter access, plain text editor, FTP client

 
  • Applies to: (gs)
    • Difficulty: Easy
    • Time Needed: 10
    • Tools Required: AccountCenter access, plain text editor, FTP client

Overview

The (gs) Grid-Service offers you the option of choosing between several different versions of PHP.

TIP:

Any new domains added to your (gs) Grid-Service will default to using PHP stable.

Instructions

You can choose your version of PHP from the AccountCenter. The specific version of PHP 5 offered here is the (mt) Media Temple-recommended version for both stability and security: Version 5.3. This version of PHP 5 includes the Suhosin hardening patches.

  1. Log into your AccountCenter.
  2. From the Overview page or Domains tab, select your primary domain. See Figure 1.


    Figure 1.

  3. This opens your (gs) Grid-Service Control Panel. Click on PHP Settings, see Figure 2.

    AC CP PHPSettings.jpg
    Figure 2. Click for a larger view.

  4. Now, select your desired version of PHP.
  5. Click save. The appropriate AddHandler line will be added to your .htaccess file.

NOTE:

We recommend moving away from PHP 4, if possible. The available version of PHP 4 is updated with all security patches available for that version of PHP, but is not compatible with the extra security features available with the Suhosin patches. Also, deprecated versions of PHP will soon be phased out.

Manually set PHP version

This section provides instructions on using a version of PHP that is older or newer than the default one available on the (gs) Grid-Service platform. Note that the default versions described above are the only guaranteed stable versions that we suggest. However, both older and newer versions of PHP are frequently available for your use, for the purposes of application compatibility.

CAUTION:

Use a non-default version of PHP at your own risk.

Older versions of PHP are typically "left over" from previous stable versions. They are typically fully integrated with the (gs) Grid-Service, but may not have the latest security features.


Note: PHP 4 and PHP 5.2 are no longer supported by the PHP Group. For more information, see the announcements for PHP 4 EOL and PHP 5.2 EOL.


Newer versions of PHP are intended to be as bleeding-edge as is possible on a shared platform (you'll need a (dv) Dedicated-Virtual Server or (ve) Server to be able to grab new versions the day they come out). These versions may not be stable and may not be fully integrated with the grid, and almost certainly do not have all the components (gs) Grid-Service customers have come to expect.

Latest version

Follow these instructions to always use the latest version of PHP that (mt) Media Temple has built into the (gs) Grid-Service. You won't have to update the version every time a new one comes out - the link does the work for you.

  1. Add the following lines to your .htaccess file:

    Filename: .htaccess

    AddHandler php-latest .php
  2. Upload your file to the directory you want to use for testing the newest version of PHP. Typically, this will be your /home/00000/domains/example.com/ directory.

Now all PHP scripts in that folder will use the latest version of PHP.

Stable version

Follow these instructions to always use the stable version of PHP that (mt) Media Temple has built into the (gs) Grid-Service. You won't have to update the version every time a new one comes out - the link does the work for you.

  1. Add the following lines to your .htaccess file:

    Filename: .htaccess

    AddHandler php-stable .php
  2. Upload the file to the directory that you want to use the specific version of PHP. Typically, this will be /home/00000/domains/example.com/.

Now all PHP scripts in that folder will use the stable version of PHP.

Resources


User Comments

No visitor comments posted. Post a comment
Fields marked with an asterisk(*) are required. Comment on this article
Fill out the form below if you would like to comment on this article.
 
 
 

(code is not case-sensitive)
 
Submit
 
 

Continue