Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
litespeed_wiki:plesk:php_guide [2017/10/06 21:37]
Jackson Zhang
litespeed_wiki:plesk:php_guide [2018/09/17 19:33]
Michael Alegre [Debian Users]
Line 3: Line 3:
 LiteSpeed Web Server requires PHP built with [[http://​www.litespeedtech.com/​products/​litespeed-sapi/​php|LSAPI]],​ our optimized SAPI. Plesk has those binary packages built into their multi-version PHP rpms for CentOS, Ubuntu, and Debian. ​ LiteSpeed Web Server requires PHP built with [[http://​www.litespeedtech.com/​products/​litespeed-sapi/​php|LSAPI]],​ our optimized SAPI. Plesk has those binary packages built into their multi-version PHP rpms for CentOS, Ubuntu, and Debian. ​
  
-The script will automatically do everything necessary for new LSWS installationsif you are setting up a new LSWS installation you may skip this guide without any problems.+The script will automatically do everything necessary for new LSWS installationsif you are setting up a new LSWS installation you may skip this guide without any problems.
  
-If you have an existing LSWS installation and would like to convert LiteSpeed to support Plesk PHP selector or are want to know how Plesk PHP selector works with LiteSpeed, the following wiki will outline the necessary steps to setup or convert to Plesk PHP selector for LiteSpeed.+If you have an existing LSWS installation and would like to convert LiteSpeed to support ​the Plesk PHP selectoror want to know how the Plesk PHP selector works with LiteSpeed, the following wiki will outline the necessary steps to set up or convert to the Plesk PHP selector for LiteSpeed.
  
 ====== CentOS/​Ubuntu/​Debian Users ====== ====== CentOS/​Ubuntu/​Debian Users ======
  
-Plesk versions older than 12.0 only support having a single version of PHP setup. Multi-PHP support started in Plesk 12.0. For CentOS/​Ubuntu/​Debian users, lsphp will be installed through plesk-php-cli packages.+Plesk versions older than 12.0 only support having a single version of PHP set up. Multi-PHP support started in Plesk 12.0. For CentOS/​Ubuntu/​Debian users, lsphp will be installed through plesk-php-cli packages.
  
   /​opt/​plesk/​php/​5.5/​bin/​lsphp   /​opt/​plesk/​php/​5.5/​bin/​lsphp
Line 25: Line 25:
   plesk-php70-cli   plesk-php70-cli
  
-if any PHP versions are not installed, you can install them through the command line:+If any PHP versions are not installed, you can install them through the command line:
  
   plesk sbin autoinstaller --select-product-id plesk --select-release-current ​ --install-component phpx.x   plesk sbin autoinstaller --select-product-id plesk --select-release-current ​ --install-component phpx.x
Line 35: Line 35:
 ===== Setting up Multiple PHPs for LSWS on Plesk >= 12.0 through the script =====  ===== Setting up Multiple PHPs for LSWS on Plesk >= 12.0 through the script ===== 
   ​   ​
-The quickest and easiest way to setup/migrate LiteSpeed to support multiple PHP versions is to download and run the following script as root:+The quickest and easiest way to set up/migrate LiteSpeed to support multiple PHP versions is to download and run the following script as root:
  
   wget http://​www.litespeedtech.com/​packages/​plesk/​migrate_litespeed_plesk_multi_php.sh   wget http://​www.litespeedtech.com/​packages/​plesk/​migrate_litespeed_plesk_multi_php.sh
Line 184: Line 184:
  
 Please see the [[litespeed_wiki:​php:​rpm#​installing_php_from_remi_repo|LiteSpeed Repository wiki entry]] for a full guide on installing PHP for LSWS from the Remi Repo. Please see the [[litespeed_wiki:​php:​rpm#​installing_php_from_remi_repo|LiteSpeed Repository wiki entry]] for a full guide on installing PHP for LSWS from the Remi Repo.
- 
-=== Building PHP from the source code === 
- 
-Building PHP from the source code is not recommended for CentOS users as RPM installation is much quicker. Users using an OS other than CentOS may have to compile PHP from the source code. This can be done from the command line or from the LSWS WebAdmin Console using our Build PHP tool. 
- 
-Please see the [[litespeed_wiki:​php:​lsapi|Compiling PHP for LSWS (with LSAPI) wiki]] for a full guide on building PHP for LSWS through the WebAdmin Console. 
- 
 ==== Debian Users ==== ==== Debian Users ====
  
-For Debian 8, please follow the instructions in the [[litespeed_wiki:​php:​apt|install php5-litespeed package from the LiteSpeed repository wiki]] to install the php5-litespeed binary from our repository ​or the [[litespeed_wiki:​php:​lsapi|compile PHP from source code wiki]]. For Debian 7, you can [[litespeed_wiki:​php:​lsapi|compile PHP from source code]].+For Debian 8, please follow the instructions in the [[litespeed_wiki:​php:​apt|install php5-litespeed package from the LiteSpeed repository wiki]] to install the php5-litespeed binary from our repository.
  
 ==== Ubuntu Users ==== ==== Ubuntu Users ====
Line 201: Line 194:
 ====== For CloudLinux Users ====== ====== For CloudLinux Users ======
  
-===== How to configure LSWS to use CloudLinix PHP selector on Plesk =====+===== How to configure LSWS to use the CloudLinix PHP selector on Plesk =====
  
-On CloudLinux system, you can use either Plesk multi-php or CloudLinux PHP selector at your choice. When installing LSWS, the installation script will automatically ​config php to use Plesk multi-php and use php version 5.6 by default. ​+On CloudLinux system, you have a choice of using either Plesk Multi-PHP or CloudLinux PHP Selector. When installing LSWS, the installation script will automatically ​configure PHP to use Plesk Multi-PHP and to use PHP version 5.6 by default. ​
  
-The followings are default external apps added to LSWS during the installationlsphp5x and lsphp7x are for Plesk Mult-PHP. lsphp_selector is for CloudLinux PHP Selector. ​+The following ​default external apps are added to LSWS during the installation: ''​lsphp5x'' ​and ''​lsphp7x'' ​are for Plesk Multi-PHP. ''​lsphp_selector'' ​is for CloudLinux PHP Selector. ​
  
 {{ :​litespeed_wiki:​plesk:​plesk-installation-php-external-apps.png?​800 |}} {{ :​litespeed_wiki:​plesk:​plesk-installation-php-external-apps.png?​800 |}}
  
-lsphp_selector is configured to use command: /​usr/​local/​bin/​lsphp+''​lsphp_selector'' ​is configured to use the command: ​''​/​usr/​local/​bin/​lsphp''​
 {{ :​litespeed_wiki:​plesk:​plesk-installation-php-external-apps-lsphp-selector.png?​700 |}} {{ :​litespeed_wiki:​plesk:​plesk-installation-php-external-apps-lsphp-selector.png?​700 |}}
- 
  
 By default, we configure Plesk Multi-PHP 56 as default handler out of the box. By default, we configure Plesk Multi-PHP 56 as default handler out of the box.
Line 217: Line 209:
 {{ :​litespeed_wiki:​plesk:​plesk-installation-php-external-apps-php-handler-default.png?​700 |}} {{ :​litespeed_wiki:​plesk:​plesk-installation-php-external-apps-php-handler-default.png?​700 |}}
  
-If you want to set CloudLinux PHP selector ​as handler instead, you will need to change .php and .php5 handler ​from "lsphp56" ​to "lsphp_selector" ​as the following, assuming that you have installed CloudLinux CageFS, enabled CageFS for all users, and PHP-selector ​and lvemanager have also been installed and configured correctly.+If you want to set CloudLinux PHP Selector ​as the handler instead, you will need to change ​**.php** and **.php5** handlers ​from ''​lsphp56'' ​to ''​lsphp_selector'' ​as the following, assuming that you have installed CloudLinux CageFS, enabled CageFS for all users, and PHP-Selector ​and lvemanager have also been installed and configured correctly.
  
 {{ :​litespeed_wiki:​plesk:​plesk-installation-php-external-apps-php-handler-to-php-selector.png?​700 |}} {{ :​litespeed_wiki:​plesk:​plesk-installation-php-external-apps-php-handler-to-php-selector.png?​700 |}}
  
-If you have not installed and configured CloudLinux PHP selector ​yet, you can take a look the following steps before you configure on LSWS as above.+If you have not installed and configured CloudLinux PHP Selector ​yet, you can take a look the following steps before you configure on LSWS as above.
  
 ===== How to install and configure CloudLinix PHP selector ===== ===== How to install and configure CloudLinix PHP selector =====
  
 ==== Install CloudLinux PHP Selector ==== ==== Install CloudLinux PHP Selector ====
-If php-selector was not installed, try the steps described in [[http://​docs.cloudlinux.com/​index.html?​php_selector_installation.html|this installation guide]].+If ''​php-selector'' ​was not installed, try the steps described in [[http://​docs.cloudlinux.com/​index.html?​php_selector_installation.html|this installation guide]].
  
   yum groupinstall alt-php   yum groupinstall alt-php
Line 232: Line 224:
   yum update cagefs lvemanager   yum update cagefs lvemanager
  
-==== Setup native PHP for LiteSpeed ====+==== Set up native PHP for LiteSpeed ====
  
-Almost all PHP versions can be handled by CloudLinux PHP selector ​directly, however native ​mode for LiteSpeed needs to be installed and configured manually.+Almost all PHP versions can be handled by CloudLinux PHP Selector ​directly, however native ​PHP for LiteSpeed needs to be installed and configured manually.
  
 When you install LiteSpeed through the plesk-litespeed extension, it will ask you for the default PHP version. You can determine the native PHP version by printing the PHP interpreter summary using the following command: When you install LiteSpeed through the plesk-litespeed extension, it will ask you for the default PHP version. You can determine the native PHP version by printing the PHP interpreter summary using the following command:
Line 312: Line 304:
   /​usr/​bin/​cl-selector --select=php --version=x.x(or native) --user=USERNAME   /​usr/​bin/​cl-selector --select=php --version=x.x(or native) --user=USERNAME
  
-Which will set desired current PHP version for particular user.+Which will set the desired current PHP version for particular user.
  • Admin
  • Last modified: 2019/09/19 19:31
  • by Lisa Clarke