美文网首页
一键lnmp安装多个版本php

一键lnmp安装多个版本php

作者: 码农工号9527 | 来源:发表于2019-11-23 19:18 被阅读0次

一键lnmp1.4配置的php没有7.3版本,此时想要再多一个php7.3的版本,需要用lnmp1.6操作。
1.查看自己的php

[root@localhost ~]# whereis php
php: /usr/bin/php /usr/local/php
[root@localhost ~]# php -v
PHP 5.6.31 (cli) (built: Jan 28 2019 17:29:03) 
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend Guard Loader v3.3, Copyright (c) 1998-2014, by Zend Technologies

2.下载lnmp1.6

[root@localhost ~]# wget http://soft.vpser.net/lnmp/lnmp1.6-full.tar.gz

3.解压并进入lnmp1.6

[root@localhost ~]# tar zxf lnmp1.6-full.tar.gz && cd lnmp1.6-full

4.安装自己想要的php版本

[root@localhost ~]# ./install.sh mphp

5.再次查看php

[root@localhost ~]# whereis php
php: /usr/bin/php /usr/local/php7.3 /usr/local/php

6.查看nginx配置多了一个php7.3文件,php安装的目录多了一个7.3的

[root@localhost ~]# vim /usr/local/nginx/conf/
enable-php7.3.conf        enable-ssl-example.conf   fastcgi_params            koi-win                   mime.types.default        pathinfo.conf             scgi_params.default       vhost/                    
enable-php.conf           fastcgi.conf              fastcgi_params.default    magento2-example.conf     nginx.conf                rewrite/                  uwsgi_params              win-utf                   
enable-php-pathinfo.conf  fastcgi.conf.default      koi-utf 
[root@localhost ]# cd /usr/local/
aegis/         bin/           etc/           games/         kafka/         lib64/         man/           my_zookeeper/  php/           sbin/          src/           
autoconf-2.13/ erlang/        freetype/      include/       lib/           libexec/       mysql/         nginx/         php7.3/        share/         zend/

7.创建nginx 的vhost配置,设置为enable-php.conf为7.3;

{
        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.3.conf;
 
        location /nginx_status
        {
            stub_status on;
            access_log   off;
        }
 
        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
            expires      30d;
        }
      ......

相关文章

网友评论

      本文标题:一键lnmp安装多个版本php

      本文链接:https://www.haomeiwen.com/subject/rjohwctx.html