Windows:修订间差异
跳转到导航
跳转到搜索
无编辑摘要 |
|||
| (未显示2个用户的4个中间版本) | |||
| 第1行: | 第1行: | ||
== 查看80端口占用的程序 == | == 查看80端口占用的程序 == | ||
# netstat -aon|findstr "80" | # <code>netstat -aon|findstr "80"</code> | ||
# 拿到上一步返回的pid,<code>tasklist|findstr {PID}</code> | # 拿到上一步返回的pid,<code>tasklist|findstr {PID}</code> | ||
== 切换hosts工具 == | |||
* SwitchHosts! 切换hosts | |||
== PHP-FastCGI on Windows == | |||
在windows环境下使用RunHiddenConsole运行php-cgi。 | |||
[https://www.nginx.com/resources/wiki/start/topics/examples/phpfastcgionwindows/] | |||
# 安装nginx windows版本[https://windows.php.net/] | |||
# 安装php windows版本[https://windows.php.net/] [https://windows.php.net/downloads/releases/] | |||
# 安装RunHiddenConsole[https://redmine.lighttpd.net/attachments/download/660/RunHiddenConsole.zip] | |||
start-php-fcgi.bat | |||
<nowiki> | |||
@ECHO OFF | |||
ECHO Starting PHP FastCGI... | |||
taskkill /F /IM php-cgi.exe | |||
RunHiddenConsole.exe php-cgi.exe -b 127.0.0.1:9000 -c d:\dev\php-5.6.9\php.ini | |||
RunHiddenConsole.exe php-cgi.exe -b 127.0.0.1:9001 -c d:\dev\php-5.6.9\php.ini | |||
RunHiddenConsole.exe php-cgi.exe -b 127.0.0.1:9002 -c d:\dev\php-5.6.9\php.ini | |||
RunHiddenConsole.exe php-cgi.exe -b 127.0.0.1:9003 -c d:\dev\php-5.6.9\php.ini | |||
</nowiki> | |||
start-nginx.bat | |||
<nowiki> | |||
:: 关闭回显,即执行本脚本时不显示执行路径和命令,直接显示结果 | |||
@echo off | |||
rem @author luwuer | |||
color f8 | |||
set NGINX_DIR=D:\dev\nginx\ | |||
cd %NGINX_DIR% | |||
:INFO | |||
echo. | |||
echo --------------------- 进程列表 --------------------- | |||
tasklist|findstr /i "nginx.exe" | |||
if errorlevel 1 echo nginx未启动 | |||
echo --------------------- 进程列表 --------------------- | |||
echo. | |||
echo. 1. 启动Nginx | |||
echo. 2. 关闭Nginx | |||
echo. 3. 重启Nginx | |||
echo. 4. 退出 | |||
echo. | |||
echo 请输入功能序号: | |||
set /p id= | |||
if "%id%"=="1" goto START | |||
if "%id%"=="2" goto STOP | |||
if "%id%"=="3" goto RESTART | |||
if "%id%"=="4" exit | |||
pause | |||
:START | |||
if exist "%NGINX_DIR%nginx.exe" ( | |||
cd /d %NGINX_DIR% | |||
start "" nginx.exe | |||
echo 启动成功 | |||
) else ( | |||
echo "%NGINX_DIR%nginx.exe不存在" | |||
) | |||
goto INFO | |||
:STOP | |||
taskkill /F /IM nginx.exe > nul | |||
echo 已关闭所有nginx进程 | |||
goto INFO | |||
:RESTART | |||
taskkill /F /IM nginx.exe > nul | |||
if exist "%NGINX_DIR%nginx.exe" ( | |||
cd /d %NGINX_DIR% | |||
start "" nginx.exe | |||
) else ( | |||
echo "%NGINX_DIR%nginx.exe不存在" | |||
) | |||
echo 已重启 | |||
goto INFO | |||
goto :eof | |||
</nowiki> | |||