Support / KnowledgeBase

 
Search the KnowledgeBase Search

How can I Specify the version of php for web applications on the (gs) Grid-Service?

  • Applies to: (gs)

  • Difficulty: Easy

  • Time needed: 5 minutes

  • Tools needed: None

 

This article describes how to use a version of PHP older than the default one available on the (gs) Grid-Service platform. (mt) Media Temple strives to keep PHP and other system frameworks updated to a recent stable version on our shared hosting services.  In most cases this results in better security and improved performance, but some applications can be incompatible.

Please follow the step below to use a different version of PHP:

  1. The list of available versions will vary, but may be found using SSH by running:

     ls -1 /usr/local/ | grep php-
  2. Navigate to the top directory of your application, such as /home/#####/domains/mt-example.com/html/blog and create a .htaccess file with the following directive:

    Action php5-script /gs-bin/php-5.1.6-6
    AddHandler php5-script .php

    Now all scripts in this directory that end in .php will be processed by php version 5.1.6-6. This version may be substituted with any other version listed.

    NOTE:

    You can provide a specific version of php from within your (ac) AccountCenter.


    1) Login to your (ac) AccountCenter

    2) Click on your Primary Domain

    3) Click on PHP Settings

    4) Now simply choose which version of PHP you wish to use for your domains

     

Notes/Supplemental Resources:

Revisions:


05-21-2008: Fixed a missing return in the code box and cosmetic changes.

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