(gs):Set specific PHP version for command line

  • This page was last modified on November 22, 2010, at 10:58.
The (mt) Community Wiki is a collaborative project. Any (mt) Media Temple customer or employee may contribute. Not all articles and/or content have been tested for accuracy by (mt) Media Temple.

For officially moderated and tested articles, be sure to visit our KnowledgeBase.

From (mt) Community Wiki


Currently, PHP 4.4.8 is the bash client version used for SSH on the (gs) Grid-Service. This is defined by the environment variable for your particular (gs) Grid-Service Cluster.

  1. To select the latest stable PHP 5 client version instead, just add the following line to your .bash_profile:
    .bash_profile
    export PATH=/usr/local/php5/bin:$PATH
    
    • You can also use the echo command to enter it in the .bash_profile automatically:
    echo export 'PATH=/usr/local/php5/bin:$PATH' >> ~/.bash_profile
    
  2. Then, reload your bash configuration:
    source .bash_profile
    
  3. Once this is done, run the following command to view the new version:
    php -v
    
    PHP 5.2.5 (cli) (built: Jan 18 2008 12:24:25) 
    Copyright (c) 1997-2007 The PHP Group
    Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
        with Zend Optimizer v3.3.0, Copyright (c) 1998-2007, by Zend Technologies