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 ...
随机推荐
- 简明Linux命令行笔记:touch
创建文件或修改文件时间 touch [options] file-list 参数 file-list是touch将要创建或更新的文件路径名 选项 -a 只更新访问 ...
- http.sys的简单应用
//public void Run() //{ // //httpListener提供一个简单,可通过编程方式控制的Http协议侦听器.此类不能被继承. // if (!HttpListener.Is ...
- iOS: block参数
先看一下 NSArray 是怎么传递 block 参数的 ... @interface NSArray (NSExtendedArray) … #if NS_BLOCKS_AVAILABLE - (v ...
- 配置IP
配置目的:配置IP为静态,让IP地址不变,方便长时间连接. 几个命令: dhclient 自动获取IP; 杀死进程:dhclient -r ip addr 显示网卡情况,了解到IP地址: 编辑配置文件 ...
- C++ 著名程序库 概览
本文转载自: http://ace.acejoy.com/thread-3777-1-1.html 1.C++各大有名库的介绍--C++标准库 2.C++各大有名库的介绍--准标准库B ...
- php 获取某文件内容
获取某文件下 的文件夹和文件 public function dirRead($dir=''){ //$dir = './upload/images'; $result = ''; if (is_di ...
- Mac OS终端中设置颜色高亮和自动补全
已测试通过,原文:http://blog.csdn.net/songjinshi/article/details/8945809 一.颜色高亮显示 针对terminal采用bash模式: 编辑 ~/. ...
- MarkDown技巧:两种方式实现页内跳转
MarkDown技巧:两种方式实现页内跳转 本人邮箱:JohnTsai.Work@gmail.com,欢迎交流讨论. 欢迎转载,转载请注明网址:http://www.cnblogs.com/JohnT ...
- “NHibernate.Cfg.Configuration 的类型初始值设定项引发异常。”的解决方法【备忘】
今天搞到NHibernate时,突然报了一个“NHibernate.Cfg.Configuration 的类型初始值设定项引发异常.”的异常. 详细异常信息“System.IO.FileLoadExc ...
- Java加密和C#解密=>DES方法
Java加密代码: import javax.crypto.*; import javax.crypto.*; import java.io.UnsupportedEncodingException; ...