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
litespeed_wiki:plesk:php_guide [2019/09/19 14:36]
Jackson Zhang
litespeed_wiki:plesk:php_guide [2019/09/19 19:31] (current)
Lisa Clarke Copyediting
Line 1: Line 1:
-====== Using PHP with Plesk and LSWS ======+====== Using PHP with Plesk and LiteSpeed Web Server ​======
  
-LSWS 5.4.x and up should work with Plesk out of the box after the installation ​since LSWS 5.4.x will auto-detect to load all available PHP versions and there is no need to config ​individual PHP external ​app if no special ​requirement. If you upgrade LSWS from an earlier version, there might be some exiting internal apps and script handlers defined+LiteSpeed Web Server v5.4 and later auto-detects and loads all available PHP versionsThis means PHP should work with Plesk out-of-the-box after LSWS installation. ​There is no need to configure ​individual PHP external ​apps if you don't have any special ​requirements
  
-LSWS will read Plesk Apache configuration files for virtual hosts and global ​settings ​hence LSWS won't have its own native virtual ​host on Plesk. ​ +If you upgrade ​LSWS from an earlier version, there may be some existing internal apps and script handlers defined. There is no need to change any settings ​from LSWS Web Admin Console, as LSWS doesn't have its own native virtual ​hosts under Plesk. ​. If you need to change PHP versions or settings, you can simply ​do so through ​Plesk Admin (**Domain > PHP Settings**)the same way you would for Apache. ​LSWS reads Plesk Apache configuration files for virtual hosts and global settings
- +
-The following wiki is not necessary steps you have to do during the installation since LSWS should just work with Plesk PHPs after installation automaticallybut rather to explain how LSWS works with Plesk PHPs.+
  
 +Use this wiki as a means of understanding how LiteSpeed Web Server and Plesk work together in terms of PHP. You shouldn'​t need to take these steps during installation,​ because LSWS should //just work// with Plesk PHP right away.
  
 ====== CentOS/​Ubuntu/​Debian Users ====== ====== CentOS/​Ubuntu/​Debian Users ======
-LiteSpeed Web Server requires LSPHP and Plesk has those binary packages ​built into their multi-version PHP rpms for CentOS, Ubuntu, and Debian ​and automatically installed when you installed ​any version of Plesk Mutli-phps.+LiteSpeed Web Server requires LSPHP, which Plesk has built into its multi-version PHP rpms for CentOS, Ubuntu, and Debian. LSPHP is automatically installed when you install ​any version of Plesk Multi-PHP.
  
-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 when you install any PHP version.+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 when you install any PHP version.
  
  
Line 47: Line 46:
 ==== Verify Apache Ignore Modules ==== ==== Verify Apache Ignore Modules ====
  
-Check the LiteSpeed setting ​ [[https://​www.litespeedtech.com/​docs/​webserver/​config/​general#​apacheIgnoredModules|Apache Ignore ​modules]] located in ''​LiteSpeed ​Web Admin Console ​-> Server ​-> General ​-> Using Apache Configuration File -> Ignore Apache Modules''​. Make sure the following modules are ignored: ''​mod_php5,​sapi_apache2,​python,​mod_php4,​mod_php7'',​otherwise you may experience ​""​Forbidden:​ PHP engine is disable." error, which is possibly caused by a php admin setting within those modules. ​However, ​''​mod_fcgid''​ should **NOT** be ignored.+Check the LiteSpeed setting ​ [[https://​www.litespeedtech.com/​docs/​webserver/​config/​general#​apacheIgnoredModules|Apache Ignore ​Modules]] located in the LiteSpeed ​WebAdmin ​Console ​under **Server > General > Using Apache Configuration File**. Make sure the following modules are ignored: ''​mod_php5,​sapi_apache2,​python,​mod_php4,​mod_php7'',​ otherwise you may experience ​"​Forbidden:​ PHP engine is disabled." error, which is possibly caused by a PHP admin setting within those modules. ​ 
 + 
 +NOTE: ''​mod_fcgid''​ should **NOT** be ignored.
  
 ==== Must use FastCGI Application,​ not php-fpm ==== ==== Must use FastCGI Application,​ not php-fpm ====
  
-''​Plesk Admin -> Domains ​-> example.com ​-> PHP settings''​, when setting up PHP for a domain, PHP should be run as a FastCGI application instead of FPM application. Currently the LiteSpeed PHP selector doesn'​t work with FPM applications.+In Plesk Admin, under **Domains > example.com > PHP settings**, when setting up PHP for a domain, PHP should be run as a ''​FastCGI application'' ​instead of ''​FPM application''​. Currently the LiteSpeed PHP selector doesn'​t work with FPM applications.
  
 {{ :​litespeed_wiki:​plesk:​plesk-php-fastcgi.png?​nolink&​700 |}} {{ :​litespeed_wiki:​plesk:​plesk-php-fastcgi.png?​nolink&​700 |}}
Line 57: Line 58:
 ==== Verify your lsphp installations ==== ==== Verify your lsphp installations ====
  
-Please refer to [[https://​kb.plesk.com/​en/​125146|this ​plesk documentation]] to ensure Plesk multi-version PHPs have been installed. It can also be checked through the Plesk GUI: ''​Add/Remove Components ​-> Web hosting features ​-> Different PHP interpreters ​versions''​. Install them if they are not yet installed.+Please refer to [[https://​kb.plesk.com/​en/​125146|this ​Plesk documentation]] to ensure Plesk'​s ​multi-version PHPs have been installed. It can also be checked through the Plesk GUI under **Add/Remove Components > Web hosting features > Different PHP interpreter ​versions**. Install them if they are not yet installed.
  
 {{ :​litespeed_wiki:​plesk:​php_components.png?​nolink&​600 |}} {{ :​litespeed_wiki:​plesk:​php_components.png?​nolink&​600 |}}
  
-The lsphp binary is included in the plesk-phpxx-cli ​package and the installation location should be:+The LSPHP binary is included in the Pleas PHPxx CLI package and the installation location should be:
  
   find / | grep /bin/lsphp   find / | grep /bin/lsphp
Line 95: Line 96:
   ( x.x here can be 5.2, 5.3, 5.4, 5.5, 5.6, 7.0, any missing version). ​   ( x.x here can be 5.2, 5.3, 5.4, 5.5, 5.6, 7.0, any missing version). ​
 GUI: GUI:
-Navigate to the Plesk Installer interface and choose the PHP versions you need (''​Add/Remove Components ​-> Web hosting features ​-> Different PHP interpreters ​versions''​).+Navigate to the Plesk Installer interface and choose the PHP versions you need (**Add/Remove Components > Web hosting features > Different PHP interpreter ​versions**).
  
 ==== 403 Forbidden error  ==== ==== 403 Forbidden error  ====
  
-If any suffixes are not properly setup, for example, ''​php56''​ is not set to use the ''​lsphp56''​ handler, then accounts using PHP 5.6 may still work from Apache but LiteSpeed will return a ''​403 Forbidden''​ error. This is because the related PHP handler has not yet been set for LiteSpeed Web Server.+If any suffixes are not properly setup, for example, ''​php56''​ is not set to use the ''​lsphp56''​ handler, then accounts using PHP 5.6 may still work from Apachebut LiteSpeed will return a ''​403 Forbidden''​ error. This is because the related PHP handler has not yet been set for LiteSpeed Web Server.
  
 ====== For CloudLinux Users ====== ====== For CloudLinux Users ======
Line 118: Line 119:
 {{ :​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 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.+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 |}}
  • Admin
  • Last modified: 2019/09/19 14:36
  • by Jackson Zhang