---
title: "Change PHP Version in Control Web Panel (CWP)"
description: "PHP is a popular programming language for dynamic site generation and integrating databases into web applications. Notable examples include the WordPress content management system (CMS), WHMCS..."
url: https://www.inmotionhosting.com/support/edu/control-web-panel/cwp-admin/user-and-account-management/change-php-version-in-control-web-panel-cwp/
date: 2022-05-24
modified: 2024-06-04
author: "InMotion Hosting Contributor"
image: https://www.inmotionhosting.com/support/wp-content/uploads/2022/05/cwp-change-php-version.jpg
categories: ["User and Account Management"]
type: post
lang: en
---

# Change PHP Version in Control Web Panel (CWP)

![Change PHP Version in Control Web Panel - PHP Version Switcher & PHP Selector](https://www.inmotionhosting.com/support/wp-content/uploads/2022/05/cwp-change-php-version-1024x538.jpg)

PHP is a popular programming language for dynamic site generation and integrating databases into web applications. Notable examples include the WordPress content management system (CMS), WHMCS billing system, [PHP app hosting](https://www.inmotionhosting.com/php-hosting), and Nextcloud personal cloud storage solution.

This high popularity results in a frequent need to upgrade or simply change PHP versions. A new version of PHP is released more than annually to include security bug fixes and new features. However, which PHP version(s) you need in Control Web Panel (CWP) depends on the applications you need. Below we’ll cover how to change the primary PHP version and select a specific version for different user accounts.

- [Change PHP Version in CWP](#server)
  - [Install Multiple PHP Versions](#multiple)
- [Set Multiple PHP versions with PHP Selector](#selector)
  - [Manually Set Multiple PHP Versions](#manual)
- [Edit PHP.ini in CWP](#edit)
  - [Create a PHPInfo.php File](#phpinfo)

## Change PHP Version in CWP

Follow these steps to change the main PHP version in CWP. Generally, you should select the latest version. But if you have PHP applications installed, check the software documentation as you might be better off with the recommended version instead.

1. [Log into CWP](https://www.inmotionhosting.com/support/edu/control-web-panel/install-control-web-panel-cwp/#login) as an administrator.
2. On the left, search for and select **PHP Version Switcher**.
3. Select a version from the drop-down menu. ![Control Web Panel PHP Version Switcher](https://www.inmotionhosting.com/support/wp-content/uploads/2022/05/cwp-php-version-switcher-v2-1024x542.png)
4. A list of available PHP modules will pop up below. The default options will suffice for most use cases. Unselected options you may need depending on software installed include ioncube (for WHMCS), mongodb, and redis. ![Install PHP extensions in Control Web Panel (CWP)](https://www.inmotionhosting.com/support/wp-content/uploads/2022/05/cwp-php-version-switcher-v2-extensions-1024x610.png)
5. After customizing your PHP build, select **Save & Build** at the bottom.

The page will refresh with a progress bar while compiling PHP in the background. This may take over thirty (30) minutes depending on your CWP server’s performance capabilities. You can select **View log** to check the PHP installation process. You can also find the same info from the CWP terminal with the following command:

tail -f /var/log/php-rebuild.log

### Install Multiple PHP Versions

Administrators with a [CWPpro license](https://www.inmotionhosting.com/support/edu/control-web-panel/upgrade-move-cwppro/) can install different PHP versions within CWP.

1. On the left, select **PHP Selector**.
2. Major PHP versions will be listed. To the right of each major is a drop-down menu to specify a minor PHP version to install and links to modify PHP options (extensions). Make a selection in every drop-down menu for major PHP versions you wish to install.![Install multiple PHP versions in control Web Panel (CWPpro)](https://www.inmotionhosting.com/support/wp-content/uploads/2022/05/cwp-php-selector-v2-1024x559.png)
3. Select **Start Compiler (build & install)**.

Non-CWPpro users needing multiple PHP versions can try [installing them from CWP terminal](https://www.inmotionhosting.com/support/product-guides/cloud-server/how-to-install-php/), but you’ll also have to manage it there.

## Set Multiple PHP versions with PHP Selector

CWPpro end users can change PHP versions per domain. The process is pretty straightforward.

1. On the left, select **CWP Settings** > **Php Selector**.
2. Choose a domain from the drop-down menu.![Choose a PHP version for a domain in Control Web Panel (CWPpro)](https://www.inmotionhosting.com/support/wp-content/uploads/2022/05/cwp-php-selector-1024x298.png)
3. Select from the available PHP versions.
4. Select **Update Version**.

### Manually Set Multiple PHP Versions 

Users not on a CWPpro server will still be able to see the PHP Selector. However, you won’t be able to make changes and there will be an alert stating “You need a CWPPRO license to use this module. Contact your server administrator.” 

We recommend Non-CWPpro users (on an Apache web server) ask your server administrator to install the PHP versions you need so that you can set [multiple PHP versions in .htaccess](https://www.inmotionhosting.com/support/website/multiple-php-versions/). You can edit this file from **File Management** > **File Manager**. You can also do this in the command-line interface (CLI) if shell access is enabled for your user account.

## Edit PHP.ini in CWP

Even with the correct PHP version you may need to make further changes for optimal PHP application performance. This section covers how to customize your PHP configuration file in CWP.

1. On the left, select **CWP Settings** > **Edit php.ini**.
2. Select a domain from the top if you have more than one under the account.
3. Make changes as needed. The most commonly modified attributes are upload_max_filesize, memory_limit, and max_execution_time. Also, display_errors should be set to “Off,” unless you’re troubleshooting development issues. ![Control Web Panel php.ini editor](https://www.inmotionhosting.com/support/wp-content/uploads/2022/05/cwp-php-ini-user-1024x622.png)
4. Once you’re finished making changes, select **Update changes** on the right.
5. (Optional) To add more custom changes, select **Advanced Editor** to edit the raw php.ini file.![Advanced php.ini editor in Control Web Panel](https://www.inmotionhosting.com/support/wp-content/uploads/2022/05/cwp-php-ini-user-advanced.png) Select **Save** on the right once you’re done.

### Create a PHPInfo.php File

To ensure your configuration works, you can create a phpinfo.php file. 

1. From the user panel, select **File Management** > **File Manager**.
2. Use the left-hand sidebar and navigate to the root directory for your website.
3. At the top, select **File**, and type a PHP file name. “phpinfo.php” is a common name but it can be named anything with a “.php” extension.
4. Click **Save**. 
5. Select the third (edit) button under the “Actions” column for the new PHP file.![Edit phpinfo.php in Control Web Panel (CWP) File Manager](https://www.inmotionhosting.com/support/wp-content/uploads/2022/05/cwp-user-terminal-phpinfo-edit-1024x233.png)
6. Add the following code block:<? phpinfo(); ?>![Add PHP info code in Control Web Panel File Manager](https://www.inmotionhosting.com/support/wp-content/uploads/2022/05/cwp-user-terminal-phpinfo-file.png)
7. Click **Save** on the right.
8. Visit the PHP info page in your browser.

![Create phpinfo Page](https://www.inmotionhosting.com/support/wp-content/uploads/2011/11/php_create-php-info-page_this-is-what-a-phpinfo-file-loos-like.gif)

Let us know if you have questions about configuring PHP on your [CWP server](https://www.inmotionhosting.com/support/edu/control-web-panel/).

Make sure your business, agency, or reseller clients are always connected and powered on with our optimized [Managed VPS Hosting](https://www.inmotionhosting.com/vps-hosting).
