• The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

CloudLinux, Plesk 12, Litespeed & Multiple PHP Versions

Christopher_Zeman

New Pleskian
I have PHP 5.5 working (5.3-5.6 all installed) with Litespeed on Plesk 12 but would like to give my clients the option of selecting what version they want to run. I thought it was possible using Litespeed. Was I wrong? I see all sorts of how-tos but nothing I've found seems to be complete.

Thank you,
Chris
 
Thank you for the reply. No, I have the Litespeed extension installed and PHP 5.5 working. The problem I'm having now is figuring out how to give my customers the option of selecting which PHP version they want for their sites. The option still exists in the control panel, but for Apache and PHP 5.3.3 only.

Thank you,
Chris
 
Howdy from LiteSpeed,

We haven't implemented this before but it shouldn't be too hard. I'm going to try to mash together the existing documentation and see if we can't bridge the gap. (Then we'll work on getting better documentation/implementation for Plesk and LSWS.)

From looking at the Plesk documentation, it looks like you just have to direct Plesk to the particular PHP binary: http://download1.parallels.com/Ples...inistrator-guide/index.htm?fileName=72042.htm

Well, if you're using the default PHP installed by LiteSpeed with Plesk, then it was installed via RPM. Our wiki specifies the location of PHP when installed via RPM: http://www.litespeedtech.com/support/wiki/doku.php?id=litespeed_wiki:php:rpm

For PHP 5.5, the default location is /usr/local/lsws/lsphp55/bin/lsphp
The default location for the php.ini is /usr/local/lsws/lsphp55/etc/php.ini

What I'm not sure about, though, is how to set the PHP Handler. Technically, LSWS uses LSAPI. It might be OK if you select FastCGI, though. Perhaps @IgorG has a better idea about this. If it doesn't work, perhaps we need to get back in touch with the developers and figure out a way to make this functionality work.

Cheers,

Michael
 
Thank you, Michael!

I just deleted the messages I posted as a follow-up to your reply. It just occurred to me that I forgot to mention in my original post that I was also attempting to use CageFS. It finally clicked with me that simply registering the alternate PHP versions with Plesk is all I really need to do and forego using CageFS. It seems to be, and I might be wrong, more trouble than it's worth. I just attempted to register PHP 5.2 with Plesk but it's unable to parse the PHP version so I just need to figure that part out.

Code:
# /usr/local/psa/bin/php_handler --add -displayname 5.2.17 -path /usr/local/lsws/lsphp52/bin/lsphp -phpini /usr/local/lsws/php52/etc/php.ini -type fastcgi -id 5.2
[2015-01-03 15:16:04] ERR [util_exec] proc_close() failed
Unable to register the PHP handler: Unable to parse php version : Usage: php
      php -[b|c|n|h|i|q|s|v|?] [<file>] [args...]
  Run in LSAPI mode, only '-b', '-s' and '-c' are effective
  Run in Command Line Interpreter mode when parameters are specified

  -b <address:port>|<port> Bind Path for external LSAPI Server mode
  -c <path>|<file> Look for php.ini file in this directory
  -n    No php.ini file will be used
  -h    This help
  -i    PHP information
  -l    Syntax check
  -q    Quiet-mode.  Suppress HTTP Header output.
  -s    Display colour syntax highlighted source.
  -v    Version number
  -?    This help

  args...    Arguments passed to script.
PHP 5.2.17 (litespeed) (built: Dec  2 2013 12:05:19)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
 
OK... here is where I'm at.

Plesk 12 & Litespeed with PHP 5.5.20 (installed with Litespeed) and PHP versions 5.2-5.6 all built using Litespeed. I was able to register PHP 5.2 with Plesk by directing php_handler to look at /usr/local/lsws/lsphp52/bin/php instead of .../lsphp. I also added PHP 5.2 to External App and Script Handler. I went to Plesk and changed the PHP version for one site to 5.2 and the still is still using 5.5. I've played with this for most of the day and can't seem to get anywhere. It's rather frustrating.

Chris
 
Hi Chris,

The best I can do for you right now is a workaround: http://www.litespeedtech.com/suppor...peed_wiki:multiple_phps_in_control_panel_lsws

It does not look like this Plesk functionality works with LSWS right now. The wiki above details how to set up multiple PHPs for different users, but it requires some editing of text configuration files (to add new MIME types especially). If you set it up that way, you will no longer be controlling PHP version from Plesk, but editing it directly in the vhost to assign that vhost's scripts the correct MIME type and thus send them to the correct LSAPI external application.

Please let me know if any of this doesn't make sense. I'm putting support of this feature onto our to do list.

Michael
 
Back
Top