首页 技术 正文
技术 2022年11月16日
0 收藏 779 点赞 4,660 浏览 1905 个字

编辑配置文件nginx.conf

worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 7000;
server_name localhost;
location / {
root C:/nginx/HTMS3.0/htms3.0/public;
index index.html index.htm index.php;
}
error_page 500 502 503 504 /50x.html;
location ~ \.php$ {
root C:/nginx/HTMS3.0/htms3.0/public;
fastcgi_pass 127.0.0.1:9010;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
server {
listen 7010;
server_name localhost;
location / {
root C:/nginx/HTMS3.0/htms_api/public;
index index.html index.htm index.php;
}
error_page 500 502 503 504 /50x.html;
location ~ \.php$ {
root C:/nginx/HTMS3.0/htms_api/public;
fastcgi_pass 127.0.0.1:9010;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
}

开启脚本

start_nginx.bat

@echo off
echo Starting PHP FastCGI...
C:\nginx\RunHiddenConsole.exe C:/php/php-cgi.exe -b 127.0.0.1: -c C:/php/php.ini
echo Starting nginx...
C:\nginx\RunHiddenConsole.exe C:\nginx/nginx.exe -p C:\nginxecho Starting PHP php...
C:\nginx\RunHiddenConsole.exe C:/php/php.exe -S 127.0.0.1: -t C:\nginx\html\index

启动脚本

restart_nginx.bat

taskkill /F /IM nginx.exe > nul
taskkill /F /IM php-cgi.exe > nul
@echo off
echo Starting nginx…
C:\nginx\RunHiddenConsole.exe C:\nginx\nginx.exe -p C:\nginx
echo Starting PHP FastCGI…
C:\nginx\RunHiddenConsole.exe C:\php\php-cgi.exe -b 127.0.0.1:9010 -c C:\php\php.ini
C:\nginx\RunHiddenConsole.exe C:\php\php-cgi.exe -b 127.0.0.1:9011 -c C:\php\php.ini

no input file specified 解决方法

虚拟机测试nginx 遭遇 Noinput file specified,多方查找终于找到解决办法1、 php.ini(/etc/php5/cgi/php.ini)的配置中这两项cgi.fix_pathinfo=1 (这个是自己添加的)doc_root=2、nginx配置文件/etc/nginx/sites-available/default中注意以下部分location ~ .php$ {fastcgi_pass 127.0.0.1:9000;fastcgi_index index.php;fastcgi_param SCRIPT_FILENAME /var/www/nginx-default$fastcgi_script_name;include fastcgi_params;}上面的部分路径需要根据你主机主目录的实际情况填写配置完以上部分,重启一下service nginx restart,应该没问题了

  

下一篇: Python 成长之路
相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:8,996
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,510
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,353
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,137
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,770
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,848