---
title: "Switching PHP versions"
date: "2016-02-17"
category: "php"
slug: "switching-php-versions"
---

All platforms run a secondary web server with an older PHP version alongside the default. On newer platforms ([[determining-platform-version]]), this secondary interpreter is PHP 5.4. These secondary interpreters are deprecated and should only be used temporarily until the site is updated to work with the latest PHP release.

## Setup

A site can be proxied to the secondary PHP interpreter via a [[htaccess-guide]] file in its [[where-is-site-content-served-from]].

- The secondary interpreter runs on port 9000 on all servers
- On [[determining-platform-version]] platforms, a one-time support ticket is required for initial account configuration
    - Alternatively, use [[scripting-with-beacon]]: [php\_enable\_fallback](https://api.apnscp.com/docs/class-Php_Module.html) to enable support from the terminal

Add the following to the `.htaccess` file:

RewriteEngine On
RewriteBase /
RewriteCond %{SERVER\_PORT} !=9000
RewriteRule ^(.\*)$ http://%{HTTP\_HOST}:9000/$1 [P,L,QSA]

## Verifying

Create a [[viewing-php-settings]] file (e.g., `phpinfo.php`) in the document root:

<?php phpinfo();

After loading the page, a different PHP version should appear in the heading.
