====== 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 ===== - Visit the CWP Install %%https://IP_OR_HOSTNAME:2031%% and log in. - Navigate to PHP Settings -> PHP Version Switcher. - Select the PHP Version you wish to install and click Next. - 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 - Click “Start Compiler” and that’s it! ===== PHP Selector ===== - Visit the CWP Install %%https://IP_OR_HOSTNAME:2031%% and log in. - Navigate to PHP Settings -> PHP Selector. - Install Dependencies. - Next to each new PHP version click on Edit Flags. - 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. - After selecting and setting the flags for each version, Click Start Compiler and that is it! - 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.)