DirectAdmin has a very nice system for rebuilding PHP that works almost the same way EasyApache would on cPanel. In DirectAdmin, it’s called CustomBuild 2.0. We are going to show how to properly build PHP after install litespeed

First install litespeed:

bash <( curl https://get.litespeed.sh ) your_serial_no

The install process is pretty straight forward. Select the versions of PHP you want it installed in.

Now that it’s done installing, we have to compile PHP if you see LSWS is not able to run correctly. However, with that being said there seems to be a bug when recompiling PHP versions using the GUI version of the custombuild system.

You need to recompile PHP via the command line interface. An example. You want to see what versions of PHP are installed on the server first:

cat /usr/local/directadmin/custombuild/options.conf

This will return the true versions of PHP that are installed on the server and the handler they’re using. Now you’re ready to compile php with the versions you saw listed:

cd /usr/local/directadmin/custombuild
./build update
./build clean
./build set webserver litespeed
./build set php1_mode lsphp
./build set php2_mode lsphp
./build set php3_mode lsphp
./build set php4_mode lsphp
./build litespeed
./build php n

The above would recompile PHP to use LiteSpeed. Please of course make sure you already installed LiteSpeed following the instructions on their website. Here is the line of code if you need it:

Also, check your logs /var/log/httpd to make sure you don’t have any errors. You should be set now!