How to install OpenLiteSpeed PHP 7


SystemMen - How to install OpenLiteSpeed ​​PHP 7 in CentOS 7? By default, there are many web servers using PHP-5.6. Because this is a popular version and is compatible with many applications.

However, when PHP 7 was released, its speed increased greatly and that made using PHP 7 more necessary.

In this article, I will show you how to install OpenLiteSpeed ​​web server with PHP 7.

Prepare the server

I use CentOS server 7. Execute commands with user root.

Update the operating system.

[root@centos ~]# yum update -y

Install EPEL repository.

[root@centos ~]# yum install epel-release -y

Install OpenLiteSpeed

We add OpenLiteSpeed ​​repository to CentOS 7 server.

[root@centos ~]# rpm -ivh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el7.noarch.rpm

Install the OpenLiteSpeed ​​package.

[root@centos ~]# yum install openlitespeed -y

Install PHP 7 for OpenLiteSpeed

The latest version of PHP is 7.3. Below, I will provide you with each installation command with the corresponding PHP 7 versions.

Command to install PHP 7.0.

[root@centos ~]# yum install lsphp70 lsphp70-common lsphp70-mysqlnd lsphp70-gd lsphp70-process lsphp70-mbstring lsphp70-xml lsphp70-mcrypt lsphp70-pdo lsphp70-imap lsphp70-soap lsphp70-bcmath -y

Command to install PHP 7.1.

[root@centos ~]# yum install lsphp71 lsphp71-common lsphp71-mysqlnd lsphp71-gd lsphp71-process lsphp71-mbstring lsphp71-xml lsphp71-mcrypt lsphp71-pdo lsphp71-imap lsphp71-soap lsphp71-bcmath -y

And the command to install PHP 7.2.

[root@centos ~]# yum install lsphp72 lsphp72-common lsphp72-mysqlnd lsphp72-gd lsphp72-process lsphp72-mbstring lsphp72-xml lsphp72-mcrypt lsphp72-pdo lsphp72-imap lsphp72-soap lsphp72-bcmath -y

Finally, the PHP 7.3 installation command.

[root@centos ~]# yum install lsphp73 lsphp73-common lsphp73-mysqlnd lsphp73-gd lsphp73-process lsphp73-mbstring lsphp73-xml lsphp73-mcrypt lsphp73-pdo lsphp73-imap lsphp73-soap lsphp73-bcmath -y

In the demo, I will use the PHP 7.3 installation command for the OpenLiteSpeed ​​web server.

Configure PHP 7.3 for OpenLiteSpeed

By default OpenLiteSpeed will use PHP 5 for it. Now, we need to change that.

Simple, PHP 7.3 will install into the directory a. We will link it to OpenLiteSpeed’s default PHP run file.

[root@centos ~]# ln -sf /usr/local/lsws/lsphp73/bin/lsphp /usr/local/lsws/fcgi-bin/lsphp5

You can find out more about this section here.

Start the service and open the port in Firewalld

After we finish the installation. We start its service with the following command.

[root@centos ~]# /usr/local/lsws/bin/lswsctrl start
[OK] Send SIGUSR1 to 3607

Next, open the required port on the Firewalld firewall.

[root@centos ~]# firewall-cmd --permanent --add-port=8088/tcp
success
[root@centos ~]# firewall-cmd --permanent --add-port=7080/tcp
success
[root@centos ~]# firewall-cmd --reload
success

Access OpenLiteSpeed ​​admin window and check PHP version

Now, open your browser and type the admin url of the web server. For example, my server has an address of 192.168.200.3. I will type the url is https://192.168.200.3:7080.

how-to-install-openlitespeed-php-7-01 How to install OpenLiteSpeed PHP 7
Access admin window of OpenLiteSpeed web server.

You login with the username and the default password is admin / 123456.

how-to-install-openlitespeed-php-7-02 How to install OpenLiteSpeed PHP 7
Login to OpenLiteSpeed admin window.

And now, to check PHP version. You type your server’s ip with port 8088 and uri is /phpinfo.php. For my example: http://192.168.200.3:8088/phpinfo.php.

how-to-install-openlitespeed-php-7-03 How to install OpenLiteSpeed PHP 7
Check PHP version in OpenLiteSpeed.

You can see in image above. The version is 7.3.6. So, we installed PHP 7.3 successfully.

Conclusion

With installing and using PHP 7.3 in OpenLiteSpeed. It will greatly increase your web server’s processing speed. I personally think this is necessary, you should implement it.

«« »»
2 Comments