zoukankan      html  css  js  c++  java
  • 安装篇八:配置 Nginx 使其支持 MySQL 应用

    配置说明

    (让nginx  MySQL(中间件)之间建立关系)

    第一个里程: 编写nginx.php首页文件

    第二个里程:重启nginx

    第三个里程:访问网页测试

    打开浏览器访问:http://47.108.58.170

    #1、准备环境,下载依赖软件

    第一个里程: 编写nginx.php首页文件
    [root@TEST php-7.2.29]# vim /application/nginx/html/index.php 
    <?php
        #Create connection
        $conn = new mysqli("127.0.0.1", "root", "F@m321520379");
        
        #Check connection
        if ($conn->connect_error) {
            die("Connection failed: " . $conn->connect_error);
        }
        echo "Connected successfully";
    ?>
        说明:https://blog.csdn.net/u012313382/article/details/90707741

    #2、:重启nginx

    [root@TEST php-7.2.29]# /application/nginx/sbin/nginx -s stop
    [root@TEST php-7.2.29]# /application/nginx/sbin/nginx -t
       nginx: the configuration file /application/nginx-1.4.0/conf/nginx.conf syntax is ok
       nginx: configuration file /application/nginx-1.4.0/conf/nginx.conf test is successful
    [root@TEST php-7.2.29]# /application/nginx/sbin/nginx

    #3、访问网页测试

    浏览器访问:http://47.108.58.170
        显示:Connected successfully ;代表配置成功。
  • 相关阅读:
    shell练习题4
    shell练习题3
    shell练习题2
    shell练习题1
    Docker入门
    自动化运维之ansible
    自动化运维之Saltstack
    代码管理平台
    非关系统型数据库-mangodb
    2018-08-22 第三十五课
  • 原文地址:https://www.cnblogs.com/l75790/p/12804362.html
Copyright © 2011-2022 走看看