Differences

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

Link to this comparison view

Next revision
Previous revision
litespeed_wiki:plesk:php_guide_install_lsphp [2016/07/18 19:03]
Jackson Zhang created
litespeed_wiki:plesk:php_guide_install_lsphp [2016/07/18 19:51] (current)
Jackson Zhang
Line 2: Line 2:
 **With the release of plesk lsphp binary packages in plesk offical repository, this solution is now deprecated.** **With the release of plesk lsphp binary packages in plesk offical repository, this solution is now deprecated.**
  
 +== Install lsphp through LiteSpeed Repository ==
 For Apache, plesk-php52/​plesk-php53/​plesk-php54/​plesk-php55/​plesk-php56 have been installed by Plesk. You would then need to also install **lsphp52**,​**lsphp53**,​**lsphp54**,​**lsphp55**,​**lsphp56**,​**lsphp70**for LSWS accordingly. A group installation command do them for you. For Apache, plesk-php52/​plesk-php53/​plesk-php54/​plesk-php55/​plesk-php56 have been installed by Plesk. You would then need to also install **lsphp52**,​**lsphp53**,​**lsphp54**,​**lsphp55**,​**lsphp56**,​**lsphp70**for LSWS accordingly. A group installation command do them for you.
  
Line 10: Line 11:
  
 LSPHP packages can also be installed separately one by one(refer [[litespeed_wiki:​php:​rpm#​installing_php_from_the_litespeed_repository|this wiki]]) , though it is not recommended since it takes longer time for manual installation. LSPHP packages can also be installed separately one by one(refer [[litespeed_wiki:​php:​rpm#​installing_php_from_the_litespeed_repository|this wiki]]) , though it is not recommended since it takes longer time for manual installation.
 +
 +== Configure lsphp external apps == 
 +
 +Plesk which supports multiple php normally use **php 5.6** as system default PHP. You should reconfigure **lsphp5** to point to the right binary. In LSWS's WebAdmin Console, under Configuration >> Server >> External App -> lsphp5 ​ -> update the command to **"/​usr/​local/​lsws/​lsphp56/​bin/​lsphp"​**. ​
 +
 +{{:​litespeed_wiki:​plesk:​plesk-lsphp5.png?​600|}}
 +
 +Also you need to create all other version of lsphps. In LSWS's WebAdmin Console, under Configuration >> Server >> External App, in addition to the default lsphp5 application,​ create **lsphp52/​lsphp53/​lsphp54/​lsphp55/​lsphp56** , set socket addresses to be unique to others, usually same as app name and also set the **Command** field to the corresponding lsphp binary location. For example, "​**/​usr/​local/​lsws/​lsphp5x/​bin/​lsphp**"​ (where x should be **2,3,4,5 or 6**). The rest of settings can be copied from lsphp5. If your plesk supports php 7, you should also create **"​lsphp70"​** external app the same way as above. ​
 +
 +If you prefer using the command line instead of the GUI tool, you can edit the LSWS configuration file (usually /​usr/​local/​lsws/​conf/​httpd_config.xml) by adding the configuration settings ([[litespeed_wiki:​plesk:​php_guide:​multi-php-config-lsphp-ls|refer here]]) to the <​extProcessorList>​… </​extProcessorList>​ section.
 +
 +Please refer [[litespeed_wiki:​php:​rpm|this wiki]] for default settings regarding how to create and configure external lsphp apps.
 +
 +{{:​litespeed_wiki:​plesk:​plesk-multi-php-external-apps.png?​700|}}
 +
 +
 +== Set handler for different suffixes ==
 +In LSWS Web Admin Console -> Configuration >> Server >> Script Handler, in addition to the default suffixes of **"​php"​** and **"​php5"​**,​ create the related suffixes **"​php52"​** **"​php53"​** **"​php54"​** **"​php55"​** **"​php56"​** with **Handler Type** LSAPI and **Handler Name** pointing to the newly created **lsphp52**,​**lsphp53**,​**lsphp53**,​**lsphp54**,​**lsphp55**,​**lsphp56** External Apps accordingly. If your plesk supports php 7, you should also create suffix **"​php70"​** pointing to external app **"​lsphp70"​**. ​
 +
 +If you are a command line Guru and prefer to make the changes through the LSWS configuration file, simply edit the httpd_config.xml file (usually /​usr/​local/​lsws/​conf/​httpd_config.xml) and add the configuration settings ([[litespeed_wiki:​plesk:​php_guide:​multi-php-handlers|refer here]]) to your server side <​scriptHandlerList>​… </​scriptHandlerList>​ section.
 +
 +{{:​litespeed_wiki:​plesk:​plesk-multi-php-handlers.png?​700|}}
 +
 +Gracefully restart LSWS to have these changes take effect.
 +
 +If any suffixes are not properly set up, for example, **"​php56"​** is not set to handler **lsphp56**,​ then accounts using PHP 5.6 may still work from Apache but LiteSpeed will return "403 Forbidden"​ because the related PHP handler has not yet been set for LiteSpeed Web Server.
  
  • Admin
  • Last modified: 2016/07/18 19:03
  • by Jackson Zhang