首页 > 其他 > 详细

快速搭建LNMP环境

时间:2021-07-22 23:52:57      阅读:35      评论:0      收藏:0      [点我收藏+]

安装

yum install -y nginx mariadb mariadb-server php php-mysql php-devel php-fpm

技术分享图片

配置

cd /etc/nginx/ && ls -l
cp nginx.conf{,.bak} && ls -l

vim nginx.conf
添加以下内容 
location = / {
          index index.php;
        }

        location ~ \.php {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }

修改完成后 wq 保存并退出

nginx -t

启动

systemctl start nginx php-fpm mariadb
ss -lnt (看到80 9000 3306端口)
cd /usr/share/nginx/html/ && rm -rf ./*

cat << EOF > index.php
<?php
phpinfo()
?>
EOF

使用浏览器访问 IP/index.php 看到如下图表示lnmp部署成功
技术分享图片

快速搭建LNMP环境

原文:https://www.cnblogs.com/Ryan2019/p/15046840.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!