Knowledgebase
HOW TO: Change PHP versions and settings using MultiPHP
Posted by Uvaraj N. on 11 October 2023 10:34 AM

Changing The PHP Version

MultiPHP enables you to use multiple versions of PHP on your server at the same time. To do this, follow these steps:

      1. Log in to cPanel.
         
      2. Open MultiPHP Manager:
        • On the Tools page, in the Software section, click MultiPHP Manager:

          cPanel -  Software - MultiPHP Manager icon

      3. Under System PHP Version, cPanel displays the default PHP version for your server. Any domain that does not have a PHP version explicitly set uses this version.
      4. To change the PHP version for a domain, under Set PHP Version per Domain, select the check box next to the domain for which you want to change the PHP version:

        cPanel - MultiPHP Manager - Select domain

      5. In the PHP Version list box, select the PHP version you want to use for the domain, and then click Apply:

        cPanel - MultiPHP Manager - Select version

      6. The new PHP version for the domain takes effect immediately.

 

Changing PHP Settings

In addition to changing the PHP version from cPanel, you can change various PHP settings using MultiPHP. You can enable and disable PHP extensions, as well as configuration directives such as memory_limit , upload_file_size, and many more. This feature removes the need to configure and maintain custom files for PHP settings from the command line. Instead, you control all PHP settings directly from cPanel.

To change your PHP settings, follow these steps:

      1. Log in to cPanel.
         
      2. Open MultiPHP INI Editor:
        • On the Tools page, in the Software section, click MultiPHP INI Editor:

          cPanel - Software - MultiPHP INI Editor icon

      3. BASIC MODE - Under Configure PHP INI basic settings, in the Select a location list box, select the home directory or a domain document root:

        • Under PHP Directive, locate the PHP directive you want to change.
        • cPanel - MultiPHP INI Editor - Select location
        • Under Setting, select the new setting that you want for the directive. Depending on the directive you select, you may need to use a slider to enable or disable the setting. Alternatively, you may need to type a value into a text box.
        • At the bottom of the page, click Apply. The new PHP settings take effect immediately.
      4. EDITOR MODE - Select the location that you wish to configure from the menu. You can edit either the user account’s home directory or the domain’s document root:

        • The Editor Mode section of this interface loads the contents of the php.ini file for your selected domain, if it exists. If the php.ini file does not exist, the interface loads a blank editor so that you can create your own file
        • Here you can add other php.ini setting that not available in basic setting earlier. 
        • The system saves changes to both the php.ini file in the Path section of the interface and the .user.ini file
        • For this changes to reflect, please add the desired value into Editor Mode and follow below step:

NOTE: Most of the time, you should use cPanel's MultiPHP Manager to handle overriding PHP values. However, some PHP settings are not supported by cPanel MultiPHP Manager, such as allow_url_fopen , allow_url_include and disable_functions. For this changes to reflect, please add the desired value into Editor Mode and follow below step: 

  • Login to cPanel
  • Open 'File Manager' and create an empty file named ".lsphp_restart.txt" in user directory
      • /home/USER1/.lsphp_restart.txt 
     
  • Verify the changes using phpinfo. Once reflected, you can delete ".lsphp_restart.txt" via file manager.

 

 

(0 vote(s))
Helpful
Not helpful

Comments (0)
Copyright © 1998 - 2021 Shinjiru International Inc. All Rights Reserved.