LNMP One-click Install package, install multiple versions of PHP, and open Redis and Swoole

Source: Internet
Author: User
Tags fpm install php script php

Installing multiple Versions of PHP

sudo ./install.sh mphp
Install ZendGuardLoader for PHP 7.1...unavailable now.Write ZendGuardLoader to php.ini...Creating new php-fpm configure file...Copy php-fpm init.d file...Add php-fpm7.1 service at system startup...insserv: script php-fpm7.1: service php-fpm already provided!+-------------------------------------------+|    Manager for LNMP, Written by Licess    |+-------------------------------------------+|              https://lnmp.org             |+-------------------------------------------+Starting LNMP...Starting nginx...  doneStarting mysql (via systemctl): mysql.service.Starting php-fpm  doneStarting php-fpm  done===========================================You have successfully install php-7.1.7 ===========================================

This time, you will find that the system already has multiple PHP

$ whereis phpphp: /usr/bin/php /usr/local/php /usr/local/php7.1

How to use, or to see how Nginx configuration.

There's one more enable-php7.1.conf in here.

When we create the Nginx vhost configuration, we can set it to 7.1, for example

server    {        listen 80;        #listen [::]:80 default_server ipv6only=on;        server_name jiqing.php7proj.com;        index index.html index.htm index.php;        root  /home/wwwroot/default/php7proj;        #error_page   404   /404.html;        include enable-php7.1.conf;        location /nginx_status        {            stub_status on;            access_log   off;        }        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$        {            expires      30d;        }        location ~ .*\.(js|css)?$        {            expires      12h;        }        location ~ /\.        {            deny all;        }        access_log  /home/wwwlogs/access.log;    }

Restart LNMP

sudo lnmp restart+-------------------------------------------+|    Manager for LNMP, Written by Licess    |+-------------------------------------------+|              https://lnmp.org             |+-------------------------------------------+Stoping LNMP...Stoping nginx...  done[ ok ] Stopping mysql (via systemctl): mysql.service.Gracefully shutting down php-fpm . doneGracefully shutting down php-fpm . doneStarting LNMP...Starting nginx...  done[ ok ] Starting mysql (via systemctl): mysql.service.Starting php-fpm  doneStarting php-fpm  done

This time, it's ready.

You can use two of them!

Install the Redis extension for PHP7.

1. Download

sudo wget https://pecl.php.net/get/redis-4.0.2.tgz

2. Unzip

3. Initialize with Phpize

whereis phpizephpize: /usr/bin/phpize
[email protected]:/opt/redis-4.0.2# sudo /usr/bin/phpize Configuring for:PHP Api Version:         20131106Zend Module Api No:      20131226Zend Extension Api No:   220131226

4. Installation

sudo ./configure --with-php-config=/usr/local/php7.1/bin/php-config

5.make

# make
# make testBuild complete.Don't forget to run 'make test'.+-----------------------------------------------------------+|                       ! ERROR !                           || The test-suite requires that proc_open() is available.    || Please check if you disabled it in php.ini.               |+-----------------------------------------------------------+

Make test error, modify php.ini, remove Proc_open limit.

Then continue to make test, no problem.

6.make Install

7. Add PHP.ini in

extension=redis.so

Yes, restart the LNMP, please.

Continue installing the swoole extension!

1. Download

 wget https://github.com/swoole/swoole-src/archive/v2.2.0.tar.gz

2. Unzip

3.phpize initialization

[email protected]:/opt/swoole-src-2.2.0# /usr/bin/phpize Configuring for:PHP Api Version:         20131106Zend Module Api No:      20131226Zend Extension Api No:   220131226

4. Installation

sudo ./configure --with-php-config=/usr/local/php7.1/bin/php-config

Close Proc_get_status

5.make && make Test

6.make Install

7. Configure Add PHP.ini

extension=swoole.so

Restart LNMP

LNMP One-click Install package, install multiple versions of PHP, and open Redis and Swoole

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.