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,lsphp70for LSWS accordingly. A group installation command do them for you.

yum groupinstall lsphp-all

or update all packages by running:

yum groupupdate lsphp-all

LSPHP packages can also be installed separately one by one(refer 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”.

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 (refer here) to the <extProcessorList>… </extProcessorList> section.

Please refer this wiki for default settings regarding how to create and configure external lsphp apps.

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 (refer here) to your server side <scriptHandlerList>… </scriptHandlerList> section.

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:51
  • by Jackson Zhang