Upgrading PHP LSAPI on LiteSpeed
Introduction
Upgrading PHP on LiteSpeed web server is not that hard but requires a few steps in order to bring the PHP version from the shipped version (4) to the latest version of PHP. The following will walk you through the necessary steps in order to successfully upgrade the PHP implementation in LiteSpeed web server.
Upgrading Process
Download the latest php source, currently at version 5.2.5, from php.net.
wget http://us2.php.net/distributions/php-5.2.5.tar.bz2
Unpack the PHP source.
tar -jxvf php-5.2.5.tar.bz2
Change directory to php-5.2.5/sapi
cd php-5.2.5/sapi
Download the latest PHP LSAPI source, currently at version 4.4, from litespeedtech.com
wget http://www.litespeedtech.com/packages/lsapi/php-litespeed-4.4.tgz
Unpack the PHP LSAPI source.
tar -zxvf php-litespeed-4.4.tgz
Change directory to the parent directory. You should now be in the base directory of the PHP source
cd ..
Run:
touch ac*
./buildconf --force
Configure PHP source for compile. Run ./configure --help for all options. The below options are enough to support Gallery running on a PostgreSQL database.
./configure --prefix=/usr/local/php5 --with-litespeed \
--with-config-file-path=../php --with-pgsql --with-exif --enable-bcmath \
--with-gd --with-jpeg-dir=/usr/lib --with-png-dir=/usr/lib --with-gettext
Compile PHP.
make
Change directory to the fcgi-bin folder in your Litespeed webserver installation.
cd /usr/local/lsws/fcgi-bin
Move the current lsphp binary.
mv lsphp lsphp.old
Copy the new lsphp from the source PHP source tree.
cp ~/php-5.2.5/sapi/litespeed/php ./lsphp
Test the new lsphp binary. Notice (litespeed) in the output.
# ./lsphp -v
PHP 5.2.5 (litespeed) (built: Dec 31 2007 00:56:37)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
We compiled PHP to look in ../php for its configuration file. This corresponds to the PHP folder in the base of the litespeed webserver installation. This is where you should have your php.ini file. If you need a default php.ini copy php.ini-recommended from the based of the PHP source tree.
Reference: http://www.litespeedtech.com/support/wiki/doku.php?id=litespeed_wiki:php:lsapi
Trackbacks
Use the following link to trackback from your own site:
http://www.sysadminschronicles.com/trackbacks?article_id=upgrading_litespeed_web_server&day=31&month=08&year=2007