laravel + php cgi + nginx在windows平台下的配置
1.d:\xampp\php\php-cgi.exe -b 127.0.0.1:9000 -c d:\xampp\php\php.ini
2.nginx conf配置如下:
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
#location / {
# root html;
# index index.html index.htm;
#}
location / {
root e:/source/game/public;
index index.html index.htm index.php;
try_files $uri $uri/ /index.php?$query_string;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
location ~ \.php$ {
root e:/source/game/public;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME e:/source/game/public$fastcgi_script_name;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# location / {
# root html;
# index index.html index.htm;
# }
#}
# HTTPS server
#
#server {
# listen 443 ssl;
# server_name localhost;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
# location / {
# root html;
# index index.html index.htm;
# }
#}
}
3.双击nginx.exe启动,ok
4.附上关闭进程的bat
@echo off
echo Stopping nginx...
taskkill /F /IM nginx.exe > nul
echo Stopping PHP FastCGI...
taskkill /F /IM php-cgi.exe > nul
exit
5.启动web_runat.vbs
Function process(name)
process = False
Dim o, a, i
set o = GetObject("WinMgmts:")
Set a = o.InstancesOf("Win32_Process")
For Each i In a
If InStr(UCase(name), UCase(i.Description)) <> 0 Then
process = True
Exit For
End If
Next
Set a = Nothing
Set o = Nothing
End Function
Sub closeProcess(name)
Dim o
Set o = CreateObject("Wscript.Shell")
Do While process(name) = True
o.Run "cmd.exe /C Taskkill /f /im " & name, 0
Wscript.Sleep 1000
Loop
Set o = Nothing
End Sub
Call closeProcess("nginx.exe")
Call closeProcess("php-cgi.exe")
Dim o
Set o = CreateObject("Wscript.Shell")
o.Run "..\php\php-cgi.exe -b 127.0.0.1:9000", 0
o.Run "nginx.exe", 0
Set o = Nothing
laravel + php cgi + nginx在windows平台下的配置的更多相关文章
- Django 1.6在Windows平台下的配置
Django 1.6 在Windows平台下的配置 前言 最近两天研究了下Django1.6在Windows平台中的配置安装,服务器采用Apache.期间遇到过许多新手所遇到的各种问题,也算是一种宝贵 ...
- 如何在Windows平台下安装配置Memcached
Memcached是一个自由开源的,高性能,分布式内存对象缓存系统. Memcached是以LiveJournal旗下Danga Interactive公司的Brad Fitzpatric为首开发的一 ...
- nginx在windows平台下的使用笔记
nginx主要提供反向代理及负载均衡的能力,重定向报文代理及报文数据替换也是常用功能.(参考https://www.cnblogs.com/fanzhidongyzby/p/5194895.html) ...
- 【Nginx】Windows平台下配置Nginx服务实现负载均衡
前言:废话不多说了,直接上步骤. 系统环境:win10 测试用的开发环境和服务类型:VS2022 + DotNet 6 + WebApi 1.本地先创建一个webapi项目,用于测试使用. 2.新建一 ...
- OpenCV CMake VSCode Windows 平台下运行配置及其解决方案
前言 最近在搞 计算机图形学相关的东西,有个 demo 用到了 opencv,找了 google 一圈,发现国内都没有比较好的配置和解决的办法,要不就是几年前的教程,最近正好踩坑完,其中经历了自己编译 ...
- Nginx在Windows平台的配置
Nginx在Windows平台的配置 能够使用Nginx搭建Tomcat集群,并完成负载均衡. 1.什么是Nginx 2.为什么使用Nginx 背景: 互联网飞速发展的今天,大用户量高并发已经成为互联 ...
- Windows平台下利用APM来做负载均衡方案 - 负载均衡(下)
概述 我们在上一篇Windows平台分布式架构实践 - 负载均衡中讨论了Windows平台下通过NLB(Network Load Balancer) 来实现网站的负载均衡,并且通过压力测试演示了它的效 ...
- windows平台下基于VisualStudio的Clang安装和配置
LLVM 是一个开源的编译器架构,它已经被成功应用到多个应用领域.Clang是 LLVM 的一个编译器前端,它目前支持 C, C++, Objective-C 以及 Objective-C++ 等编程 ...
- Windows平台下的读写锁
Windows平台下的读写锁简单介绍Windows平台下的读写锁以及实现.背景介绍Windows在Vista 和 Server2008以后才开始提供读写锁API,即SRW系列函数(Initialize ...
随机推荐
- Yii2 session的使用方法(3)
Flash数据是一种特别的session数据,它一旦在某个请求中设置后, 只会在下次请求中有效,然后该数据就会自动被删除. 常用于实现只需显示给终端用户一次的信息, 如用户提交一个表单后显示确认信息. ...
- asp.net c# repeater或gridview导出EXCEL的详细代码。
Response.Clear(); Response.Charset = "GB2312"; Response.ContentEncoding = System.Text.Enco ...
- 安卓开发笔记——WebView组件
我们专业方向本是JAVA Web,这学期突然来了个手机App开发的课设,对于安卓这块,之前自学过一段时间,有些东西太久没用已经淡忘了 准备随笔记录些复习笔记,也当做温故知新吧~ 1.什么是WebVie ...
- Android布局学习——android:gravity和android:layout_gravity的区别
[Android布局学习系列] 1.Android 布局学习之——Layout(布局)详解一 2.Android 布局学习之——Layout(布局)详解二(常见布局和布局参数) 3.And ...
- C语言的结构体
举例,一个结构体的定义如下: typedef struct _foo { ]; int age; int sex; } foo; 对齐 如果直接对上面的结构体作sizeof()运算: printf( ...
- Thinkphp 模板中使用自定义函数的方法
1.number_format {$number|number_format=2} 千分位,保留两位小数 2.round {$number|round=2} 四舍五入保留两位小数
- go fmt格式化----“占位符”
https://studygolang.com/articles/2644 https://studygolang.com/static/pkgdoc/pkg/fmt.htm
- 【Cesium】模型转换和使用(转)
http://52.4.31.236/convertmodel.html https://blog.csdn.net/UmGsoil/article/details/74572877 var view ...
- 【Android】录音-amr音频录制
http://www.cnblogs.com/fengzhblog/archive/2013/08/01/3231500.html http://blog.csdn.net/fan7983377/ar ...
- python commands模块在python3.x被subprocess取代
subprocess 可以执行shell命令的相关模块和函数有: os.systemos.spawnos.popen --废弃popen2.* --废弃commands.* --废弃,3.x中被移除 ...