Compiling PHP with LiteSpeed (with lsapi)

Compiling PHP with litespeed using LiteSpeed 4.10 SAPI.

You must download the latest PHP package and the litespeed sapi package to the /root directory, then run the following commands.
You may wish to change the config settings as needed.

Note: Litespeed was installed in /opt/lsws. You will want to change the prefix accordingly.

cd /root
tar -xjf php-5.3.2.tar.bz2
cd php-5.3.2
cd sapi
tar -xzf /root/php-litespeed-4.10.tgz
cd ..
touch ac*
./buildconf --force

./configure --prefix=/opt/lsws/lsphp5 --with-litespeed --with-config-file-path=/etc/ --with-gd --enable-shmop --enable-track-vars --enable-ftp --enable-sockets --enable-exif --enable-zip --enable-sysvsem --with-zlib --enable-sysvshm --enable-magic-quotes --with-jpeg-dir --with-png-dir --enable-mbstring --enable-embedded-mysqli=shared --with-curl --with-mysql=/opt/mysql --with-mysqli=/opt/mysql/bin/mysql_config --with-mcrypt
make
make install

/etc/init.d/lsws stop
sleep 5
/bin/cp sapi/litespeed/php /opt/lsws/fcgi-bin/lsphp
/etc/init.d/lsws start

Note: The ‘sleep 5’ statement is not necessary if you do these steps manually. It is added so the copy operation immediately after is successful. Otherwise, litespeed might still be running which will cause the copy operation to fail.

Leave a Reply

Your email address will not be published.