How to Configure PHP 7.2/7.1/7.0 with OpenLiteSpeed

by Sandy

In this tutorial we’ll configure PHP 7.2/7.1/7.0, by default, OpenLiteSpeed 1.4 uses PHP 5.6. It is pretty easy to configure the php version under OpenLiteSpeed dashboard. Just follow this steps in order to configure the required php version under OpenLiteSpeed

You can also look into the installation procedure of OpenLiteSpeed and php here :

How to install OpenLiteSpeed and PHP 7.2/7.1/7.0/5.6 from LiteSpeed Repositories on Centos 7/6

Login to OpenLiteSpeed admin panel :

https://1.2.3.4:7080

replace 1.2.3.4 with your server ip

Go to Server Configuration > External App

Click on ADD :

For the type, use LiteSpeed SAPI App and click next

Next, add the configuration below:-

To configure  PHP 7.2

Name: lsphp72
Address:    uds://tmp/lshttpd/lsphp.sock
Max Connections: 35
Environment: PHP_LSAPI_MAX_REQUESTS=500
             PHP_LSAPI_CHILDREN=35
Initial Request Timeout (secs): 60
Retry Timeout : 0
Response Buffering: no
Auto Start: yes
Command: $SERVER_ROOT/lsphp72/bin/lsphp
Back Log: 100
Instances: 1
Memory Soft Limit (bytes): 2047M
Memory Hard Limit (bytes):2047M
Process Soft Limit: 400
Process Hard Limit: 500

To configure  PHP 7.1

Name: lsphp71
Address:    uds://tmp/lshttpd/lsphp.sock
Max Connections: 35
Environment: PHP_LSAPI_MAX_REQUESTS=500
             PHP_LSAPI_CHILDREN=35
Initial Request Timeout (secs): 60
Retry Timeout : 0
Response Buffering: no
Auto Start: yes
Command: $SERVER_ROOT/lsphp71/bin/lsphp
Back Log: 100
Instances: 1
Memory Soft Limit (bytes): 2047M
Memory Hard Limit (bytes):2047M
Process Soft Limit: 400
Process Hard Limit: 500

To configure  PHP 7.0

Name: lsphp70
Address:    uds://tmp/lshttpd/lsphp.sock
Max Connections: 35
Environment: PHP_LSAPI_MAX_REQUESTS=500
             PHP_LSAPI_CHILDREN=35
Initial Request Timeout (secs): 60
Retry Timeout : 0
Response Buffering: no
Auto Start: yes
Command: $SERVER_ROOT/lsphp70/bin/lsphp
Back Log: 100
Instances: 1
Memory Soft Limit (bytes): 2047M
Memory Hard Limit (bytes):2047M
Process Soft Limit: 400
Process Hard Limit: 500

Ultimately configuration will look like this : CLICK HERE to see the Image

Save the config and Then go to the tab “Script Handler” and edit the “lsphp” script handler. Change the handler name to “lsphp72”. (Change accordingly with you requirement for lsphp71, lsphp70 first add the upper config then select from drop down)

Save and graceful restart OpenLiteSpeed, and Done.

Check php version by going to http://server_ip/phpinfo.php

If this post helps you in any way please consider a donation

Donate with PayPal :

md-donate

Donate with Paytm :

md-donate

You may also like

Leave a Reply

avatar
  Subscribe  
Notify of