Building PHP

As of this moment CentOS Web Panel(CWP) requires you to manually add the “--with-litespeed” flag to the configure command to build the LSAPI PHP needed to run PHP on LiteSpeed Enterprise. We are working with CWP to automate this process for users.

CWP has two different methods of assigning a PHP version/binary: through PHP Version Switcher or PHP Selector. Here we will explain how to compile PHP with LiteSpeed support using each method.

NOTE: Even if one has already compiled PHP, it will need to be recompiled with the ‘--with-litespeed’ flag before PHP will work with LiteSpeed Enterprise.

NOTE: LiteSpeed Enterprise does not work with PHP Version 4.4 or 5.2 unless manually compiled via the command line.

PHP Version Switcher

  1. Visit the CWP Install https://IP_OR_HOSTNAME:2031 and log in.
  2. Navigate to PHP Settings → PHP Version Switcher.
  3. Select the PHP Version you wish to install and click Next.
  4. You will then see a text box with ./configure and the flags that PHP is going to be built with. Scroll to the bottom of the text box,and add the following on a new line: --with-litespeed
  5. Click “Start Compiler” and that’s it!

PHP Selector

  1. Visit the CWP Install https://IP_OR_HOSTNAME:2031 and log in.
  2. Navigate to PHP Settings → PHP Selector.
  3. Install Dependencies.
  4. Next to each new PHP version click on Edit Flags.
  5. A text box near the top should pop up with ./configure and the compilation flags. Scroll to the bottom of the text box and on a new line add the following: ‘--with-litespeed’. This step is required for each version that is to be compiled.
  6. After selecting and setting the flags for each version, Click Start Compiler and that is it!
  7. Add the following code into /home/username/public_html/.htaccess:
    AddHandler application/x-httpd-php56 .php

    (Replace 56 with the PHP version you built and wish to use.)

 
litespeed_wiki/cwp/building-php.txt · Last modified: 2018/07/09 15:20 by Lisa Clarke