配置说明(NGINX-PHP)

(让nginx  php(中间件)之间建立关系):nginx--php建立关系---fastcgi---cgi

第一个里程: 编写nginx虚拟主机配置文件

第二个里程:重启nginx

第三个里程:创建测试文件

第四个里程:打开浏览器访问:http://47.108.58.170

第一步:编写nginx虚拟主机配置文件

[root@TEST php-7.2.29]# vim /application/nginx/conf/nginx.conf
server {
listen 80;
server_name www.test.com;
location / {
root html;
index index.php index.html index.htm;
}
#location ~* .*\.(php|php5)?$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# include fastcgi.conf;
#}
location ~* \.php$ {
fastcgi_index index.php;
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}

第二步:重启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

第三步:创建测试文件

[root@TEST php-7.2.29]# mv /application/nginx/html/index.html /application/nginx/html/index.html.bak
[root@TEST php-7.2.29]# echo "<?php phpinfo(); ?>" >> /application/nginx/html/index.php

第四步:打开浏览器访问

http://47.108.58.170      <——显示PHP访问首页,代表连接配置正常

最新文章

  1. 有的机器不能通过session登录
  2. 【CLR in c#】参数
  3. Web serviser请求通道在等待 00:00:59.6479648 以后答复时超时。增加传递给请求调用的超时值,或者增加绑定上的 SendTimeout 值。分配给此操作的时间可能是更长超时的一部分。
  4. sersync 实时同步工具
  5. 子查询有OR无法展开,改写成union
  6. hdu 5570 balls(期望好题)
  7. 运用JavaScript构建你的第一个Metro式应用程序(onWindows 8)(三)
  8. 高效开发之SASS篇
  9. linux下查看jdk路径
  10. 解决SpringMVC拦截器中Request数据只能读取一次的问题
  11. 通用权限管理系统多语言开发标准接口 - java,php 调用标准接口程序参考
  12. excel表格中,怎么根据一列重复的数据求对应另一列总和
  13. 虚拟机网络连接NAT模式,本地用Xshell连接
  14. KMP string pattern matching
  15. Linux修改IP网络配置
  16. vscode卡死问题
  17. C# winform DevExpress上传图片到数据库【转】
  18. ant重新编译打包hadoop-core-1.2.1.jar时遇到的错
  19. Anaconda+Tensorflow环境安装与配置
  20. Servlet------&gt;jsp EL表达式

热门文章

  1. 基础知识redis详解--【Foam番茄】
  2. 听说高手都用记事本写C语言代码?那你知道怎么编译运行吗?
  3. 编程入门选什么语言好?C 语言还是Python ?为你解析
  4. VisualStudio C++使用汇编函数
  5. linux离线安装docker + docker-compose
  6. BloomFilte布隆过滤器简介
  7. 第9.4节 Python中用readline读取二进制文件方式打开文件
  8. 第九章 Python文件操作
  9. 西湖论剑2020MISC-Yusa_yyds
  10. 团队项目6——Alpha阶段项目复审