KNOWNHOST WIKI

User Tools

Site Tools


control-panels:directadmin:how-to-choose-php-version

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
control-panels:directadmin:how-to-choose-php-version [2019/10/11 06:38]
Karson N.
control-panels:directadmin:how-to-choose-php-version [2020/06/01 14:25] (current)
Karson N.
Line 1: Line 1:
 ====== DirectAdmin's Multiple PHP Version Selection ====== ====== DirectAdmin's Multiple PHP Version Selection ======
-  
 \\ \\
  
Line 8: Line 7:
  
 {{:control-panels:directadmin:phpselectorda.png?nolink&800|}} {{:control-panels:directadmin:phpselectorda.png?nolink&800|}}
- 
  
 Clicking "PHP Version Selector" results in a pop-up box containing a drop-down listing available PHP versions from which one may choose.  Clicking "PHP Version Selector" results in a pop-up box containing a drop-down listing available PHP versions from which one may choose. 
- 
  
 {{:control-panels:directadmin:selectphpversionda.png?nolink&800|}} {{:control-panels:directadmin:selectphpversionda.png?nolink&800|}}
  
 \\ \\
- 
 ===== Installing and Configuring PHP Versions for Use with the PHP Version Selector ===== ===== Installing and Configuring PHP Versions for Use with the PHP Version Selector =====
  
Line 22: Line 18:
  
 <code> <code>
-php1_release - Default PHP version used by all unless otherwise selected +  php1_release - Default PHP version used by all unless otherwise selected 
-php2_release +  php2_release 
-php3_release +  php3_release 
-php4_release+  php4_release
 </code> </code>
  
Line 31: Line 27:
  
 To check your DirectAdmin PHP versions currently installed and enabled via the options.conf, use the following command: To check your DirectAdmin PHP versions currently installed and enabled via the options.conf, use the following command:
 +<code>
   grep -P 'php[\d]_' /usr/local/directadmin/custombuild/options.conf    grep -P 'php[\d]_' /usr/local/directadmin/custombuild/options.conf 
 +</code>
  
 This will result in output similar to the following for a server running suPHP for PHP 7.3 and PHP 5.6.  This will result in output similar to the following for a server running suPHP for PHP 7.3 and PHP 5.6. 
  
 <code> <code>
-[root@host ~]# grep -P 'php[\d]_' /usr/local/directadmin/custombuild/options.conf  +  [root@host ~]# grep -P 'php[\d]_' /usr/local/directadmin/custombuild/options.conf  
-php1_release=7.3 +  php1_release=7.3 
-php1_mode=suphp +  php1_mode=suphp 
-php2_release=5.6 +  php2_release=5.6 
-php2_mode=suphp +  php2_mode=suphp 
-php3_release=no +  php3_release=no 
-php4_release=no +  php4_release=no 
-php3_mode=php-fpm +  php3_mode=php-fpm 
-php4_mode=php-fpm +  php4_mode=php-fpm 
-[root@host ~]# +  [root@host ~]# 
 </code> </code>
- 
  
 The DirectAdmin configuration may not have all 4 versions of PHP installed and enabled upon server provisioning depending on your host. These will be set to 'no' like below if the 3rd and 4th available PHP versions are not set: The DirectAdmin configuration may not have all 4 versions of PHP installed and enabled upon server provisioning depending on your host. These will be set to 'no' like below if the 3rd and 4th available PHP versions are not set:
 +<code>
   php3_release no   php3_release no
   php4_release no   php4_release no
 +</code>
  
 If set, it will be set to the major and minor values of the version installed for that php, like so: If set, it will be set to the major and minor values of the version installed for that php, like so:
 +<code>
   php3_release 7.3   php3_release 7.3
   php4_release 5.6   php4_release 5.6
 +</code>
  
 The following example configures all 4 of the available PHP versions as well as their PHP handlers: The following example configures all 4 of the available PHP versions as well as their PHP handlers:
  
 <code> <code>
-cd /usr/local/directadmin/custombuild +  cd /usr/local/directadmin/custombuild 
-./build update +  ./build update 
-./build set php1_release 7.3 +  ./build set php1_release 7.3 
-./build set php2_release 7.2 +  ./build set php2_release 7.2 
-./build set php3_release 5.6 +  ./build set php3_release 5.6 
-./build set php4_release 5.3 +  ./build set php4_release 5.3 
-./build set php1_mode php-fpm +  ./build set php1_mode php-fpm 
-./build set php2_mode php-fpm +  ./build set php2_mode php-fpm 
-./build set php3_mode php-fpm +  ./build set php3_mode php-fpm 
-./build set php4_mode php-fpm +  ./build set php4_mode php-fpm 
-./build php n +  ./build php n 
-./build rewrite_confs+  ./build rewrite_confs
 </code> </code>
  
- You can change the version numbers and handlers around as desired for compiling your PHP versions. Note that the default PHP version is always php1_release. +You can change the version numbers and handlers around as desired for compiling your PHP versions. Note that the default PHP version is always php1_release. 
  
 \\ \\
- 
 ===== Enabling the PHP Version Selector in the DirectAdmin Configuration ===== ===== Enabling the PHP Version Selector in the DirectAdmin Configuration =====
  
 If you want your users to have access to the PHP selector to choose their own PHP version from the options above, you would need to make sure the php_version_selector setting is enabled in the DirectAdmin configuration. To check, run the following command: If you want your users to have access to the PHP selector to choose their own PHP version from the options above, you would need to make sure the php_version_selector setting is enabled in the DirectAdmin configuration. To check, run the following command:
 +<code>
   /usr/local/directadmin/directadmin c | grep php_version_selector   /usr/local/directadmin/directadmin c | grep php_version_selector
 +</code>
  
 The following output would indicate that the PHP selector is available for the users: The following output would indicate that the PHP selector is available for the users:
  
 <code> <code>
-[root@host ~]# /usr/local/directadmin/directadmin c | grep php_version_selector +  [root@host ~]# /usr/local/directadmin/directadmin c | grep php_version_selector 
-php_version_selector=1 +  php_version_selector=1 
-[root@host ~]# +  [root@host ~]# 
 </code> </code>
  
 \\ \\
- 
 ===== The CustomBuild GUI ===== ===== The CustomBuild GUI =====
  
 If you prefer to use a GUI to manage this, you can install the CustomBuild GUI Plugin. See our KH wiki for an article detailing the installation and usage of this plugin. Alternatively, you can open a support ticket with the support team and we'll be happy to install this for you! :) If you prefer to use a GUI to manage this, you can install the CustomBuild GUI Plugin. See our KH wiki for an article detailing the installation and usage of this plugin. Alternatively, you can open a support ticket with the support team and we'll be happy to install this for you! :)
control-panels/directadmin/how-to-choose-php-version.txt · Last modified: 2020/06/01 14:25 by Karson N.