PHP LSAPI Ubuntu Dapper/Edgy debian package How-To (Archive Only)
Preamble
Original Author: Stephen Leavitt Updates by Martin Lathoud
LSAPI is LiteSpeed's open-source API between external applications and LiteSpeed Web Server. This how-to is for compiling and installing PHP + LSAPI with Ubuntu php sources and create .deb debian style packages that can be used to install PHP+LSAPI on any compatible Ubuntu installation.
Why would one want this? It looks more complicated than the straight-forward php lsapi compile wiki.
- You have many web application clones running Ubuntu.
- When there is a new release of PHP-LSAPI or PHP, you just need to compile once, generate a package file, copy php-litespeed_XXX.deb file to all clones and safely update/install the servers without having to worry about misc issues.
Instructions
1) Make sure you have the latest package database
apt-get update
2) Get some required packages
apt-get install dpkg-dev devscripts libsnmp-dev apt-get build-dep php5
3) Get the current php5 source from ubuntu and place in the current folder/path
apt-get source php5
4) Go into the source directory you just downloaded from above step
cd php5-5.1.6
5) Download untar latest PHP-LSAPI tarball in sapi/
cd sapi; tar xfvz /path/to/php-litespeed-2.3.tgz; cd ..
6) Download and Test whether patch applies cleanly
wget http://www.litespeedtech.com/packages/3rd-party/ubuntu-php5-litespeed.patch patch --dry-run -p1 < ubuntu-php5-litespeed.patch
7) Apply patch if no error in above step
patch -p1 < ubuntu-php5-litespeed.patch
8) Build php5 packages however desired
dpkg-buildpackage
Go get a cup of joe while everything compiles.
9) A php5-litespeed_xxx.deb file will be created, as with other generated .deb files, in the path above current.
cd ..
10) Install the php5-litespeed package:
dpkg -i php5-litespeed_xxx.deb
To list the content of package:
dpkg -L php5-litespeed_xxx.deb
You can change from php4 to php5 by simply editing the command path to /usr/lib/cgi-bin/php5-litespeed in phpLsapi External App
Final Notes:
Litespeed php5 binary is by default installed to /usr/lib/cgi-bin/php5-litespeed
Litespeed php5 php.ini is by default installed to /etc/php5/litespeed/php.ini