Published on: October 7, 2009 by George K.
In web server management we often need PHP recompilation for Litespeed web server. LSAPI is LiteSpeed’s open-source API between external applications and LiteSpeed Web Server.This how-to is for compiling and installing PHP + LSAPI on Linux, OS X, FreeBSD, Solaris, and so on. LiteSpeed comes with PHP 4.4.x compiled with LSAPI. To change the LightSpeed php to the latest stable one, we need to recompile the php with the LSAPI for LiteSpeed.
I am trying to provide some info for doing this task.
a) Download the required php from php.net
tar -xzvf php-5.2.11.tar.bz2
b) Download and the latest LSAPI for PHP from http://www.litespeedtech.com/ into the “sapi” folder of php source:
tar -xvf php-litespeed-4.10.tgz
c) Change directory to root PHP source directory and run commands:
If you have an apache compilation already , remove the part option “–with-apxs” and use ” –with-litespeed” . Also you may need to change the “prefix” option too . So a basic configure command would be like this
./configure ‘–prefix=/lsphp5’ ‘–with-litespeed’ ‘with-mysql’
Note: You must compile PCRE support inorder for the default auto-index php script to work correctly
Post Install Configurations
1. Replace the existing lsphp binary with the new one.
Change the directory to the current installation of “lsws” ( it varies on different machines)
mv lsphp lsphp.old
cp /php-5.2.11/sapi/litespeed/php lsphp-5.2.11
ln -sf lsphp5 lsphp-5.2.11
It should return something like:
PHP 5.2.11 (litespeed) (built: Sep26 2008 14:09:09) Copyright (c) 1997-2004 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
Notice litespeed in parenthesis. This means that the PHP binary has litespeed (LSAPI) support builtin.
The php.ini file will be located at /usr/local/lsws/php/php.ini
If we want to use the old PHP.ini just copy it here.
# cd /usr/local/lsws/php # mv php.ini php.ini.old # cp /usr/local/ZEND/etc/php.ini .
Finally restart LSWS and use our new PHP binary.
For further assistance you can contact our web server management team with your requirements
Category : Apache, cPanel, General, Howtos, Linux, Training, Troubleshooting