Installing LSPHP via RPM

Installing PHP with LiteSpeed SAPI from a repository is much faster than compiling it yourself. Some users also may be unused to compiling PHP and will find this method more comfortable. PHP for LiteSpeed (LSAPI) is available in two repositories — Remi Repository and our own LiteSpeed Repository. The LiteSpeed Repository is currently being updated, though. We will add installation instructions for the LiteSpeed Repository when it is ready.

Les RPM de Remi (Remi Repository)

  • PHP 5.4, 5.5, and 5.6
  • CentOS, RHEL, and Fedora
  • Very popular and supports a wide variety of PHP configurations
  • Frequently updated
  • Allows installation of multiple builds of PHP (but only with PHP 5.6)

Installing PHP from Remi Repo

The following steps can be used to install PHP 5.5 with LSAPI on CentOS 6. Consult the Remi Repository site for installation with other builds.

Add the repositories

Remi Repository requires the EPEL repository as well.

rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm

Enable Remi Repo

Open the Remi repo file:

vi /etc/yum.repos.d/remi.repo

In the [remi-php55] section, set enabled to 1.

Note: The [remi-php55] section is for PHP 5.5. The [remi-php] section is for PHP 5.4 and the [remi-php56] section is for PHP 5.6.

Install PHP for LSWS from the repository

Remi's PHP for LSWS (PHP with LSAPI) package is called “php-litespeed”.

yum install php-litespeed

Note: You can, of course, also install any other packages you wish (such as php-opcode).

Direct LSWS to the Location of the Installed PHP

By default, Remi Repo installs PHP with LSAPI to /usr/bin/lsphp. This is not the place LSWS normally looks for PHP, so we will now need to direct LSWS to look there.

Go to the WebAdmin console > External App > your external application > Command. Change the command setting to match the location PHP was installed to (/usr/bin/lsphp).

Click Save and then perform a Graceful Restart for the changes to take effect.

Check your PHP installation

You can check that your PHP installation is correct by viewing a phpinfo() page. The phpinfo() page should show the correct version of PHP and LiteSpeed as the server API.

litespeed_wiki/php/rpm.txt · Last modified: 2014/08/27 14:48 by Michael Armstrong