1. Home
  2. PHP
  3. Switching PHP versions

Switching PHP versions

Overview

All platforms run a secondary web server with an older version of PHP other than the default. On newer platforms, v6+, this interpreter is PHP 5.4. These secondary interpreters are deprecated and should only be used temporarily until the offending site can be updated to make use of the latest, more secure release of PHP.

Usage

An site may be proxied to the secondary interpreter via a .htaccess file located in its document root.

  • All servers run the secondary interpreter on port 9000.
  • All v6+ platforms will also require a ticket to be opened only once so initial configuration may be setup for the account.

Add the following lines to the .htaccess file:

RewriteEngine On
RewriteBase /
RewriteCond %{SERVER_PORT} !=9000
RewriteRule ^(.*)$ http://%{HTTP_HOST}:9000/$1 [P,L,QSA]

Verifying

Once the rules have been setup, create a new phpinfo script in the document root, for example named phpinfo.php, that contains the following line:

<?php phpinfo();

Upon successful completion, a different PHP version will appear in the heading.

Updated on March 7, 2021

Related Articles