PHP5 on Media Temple Grid-Server

September 24th, 2008

I just recently switched a bunch of sites over to Media Temple, and was dismayed to see that by default the sites run PHP4. Since many of my projects require PHP5 I set out to figure out how to get these sites running. A fair amount of digging through the Media Temple knowlege-base revealed the answer.

  1. Create a .htaccess file in the root of the site
  2. Add the following snippet of code and save:
    
    Action php5-script /gs-bin/php-5.1.6-6
    AddHandler php5-script .php
    

Update: MediaTemple GS is now running PHP 5.2.6. To enable it, use this snippet instead:


Action php5-script /gs-bin/php-5.2.6-1
AddHandler php5-script .php

18 Comments to “PHP5 on Media Temple Grid-Server”

  • Mate – worked a treat, thank you!

  • Jess Andreas Olsen August 26, 2009 at 7:02 am

    Great tip, this helped a lot.

  • Well adding just

    AddHandler php5-script .php

    in .htaccess helped. Thanks for the tip though.

  • Thanks for the tip… I was concerned about tying this to a specific version of php, because it might break when they upgrade their version.

    Doing more hunting on their pages, I found the following way of doing this in a non version dependent way:

    > AddHandler php5-script .php
    (in your .htaccess file).

    Again, thanks, your tip got me started in the right direction.

  • Hey Morgan, totally valid concern, but FYI, they do seem to leave backwards compatibility, because I didn’t catch the last upgrade for a few months and everything continued to work fine. Good to know it can be less specific though.

  • Wonderful! This is exactly what I’m looking for and it works like a charm! Thank you.

  • Super helpful — a painless way to upgrade to php 5.2.6 on mediatemple servers!

  • really need this. thanks!

  • It worked so great, thank you for you post ^_^

  • Thanks for sharing! Exactly what I was looking for. Site worked as soon as I added this to the .htaccess file.

  • just do this.. goto MT GS CP > CLICK PHP Settings > Select PHP5 for whatever domain.

  • wow. thanks for this!!!!

  • So I have been using the Account setting process to do this for a while now. Changing the PHP settings to version 5 from the account center will just add this to the htaccess

    AddHandler php5-script .php

    But I have found that I if I add the specific version

    Action php5-script /gs-bin/php-5.2.6-1

    On some sites, specifically Stacey, the speed improvements are drastic. Without specifying the php version, the document load time is say 1s, with the php version it would drop down to 300ms.

    Just some of my findings, not sure if this is actually valid.

  • Thanks, just what I needed. I’m stuck with them where I work, Media Temple is horrible.

  • Great Note. I had an issue with updating to PHP5 from PHP4 on multibyte texts. When you choose php5 option from the admin panel, MT adds only “AddHandler php5-script .php”. This looses capability to resolve multibyte. If you put some in multibyte, it goes somewhere and only alphabet and numbers are there. Once I added the “Action php5-script /gs-bin/php-5.2.6-1,” the issue was resolved. I was looking for an answer but didn’t imagine this can resolve the issue.

    Thank you very much for sharing this tip!!

  • many many thanks sir.. It works also to me..

  • You the man Adam.

    I was dreading dealing with the MediaTemple folks for this. Slam dunk!

    Thanks.

Leave a Reply