zoukankan      html  css  js  c++  java
  • 解决PHP7+ngnix+yaf框架404的问题

    因为电脑坏了,换了一台电脑,配置了新环境。之前用的是Apache,想用一下ngnix,于是配了一套PHP7+ngnix+yaf框架的环境,但是打开配了虚拟域名之后就总是404。如果直接用localhost直接访问就可以,太蛋疼了。

    配置文件

    #相当于在http模块再添加一个server模块
    server {
        #监听绑定80端口
        listen       80;
        #下面这个是域名,多个域名用空格隔开
        server_name  x.com;
        #本网站的根路径
        root   D:/phpStudy/WWW/resource/public;
        #下面是默认首页
        location / {
            index  index.html index.php;
        }
        #下面是针对本站所有.php文件进行处理的配置
        location ~ .php{
            #fastcgi的服务信息 ip:端口
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_split_path_info ^(.+.php)(/.+)$;
            #fastcgi默认首页
            # fastcgi_index index.php;
            fastcgi_index /index.php;
            #fastcgi的参数 指定文件路径及参数,否则会有404或是file not find 提示
            fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
            #加载fastcgi  一种处理方式
            include fastcgi_params;
        }
    }
    

    参考地址

    不积跬步,无以至千里
  • 相关阅读:
    STM32的CRC32 软件实现代码
    AES CBC/CTR 加解密原理
    Either, neither, both
    Answer Sheet
    Both
    How to convert a byte to its binary string representation
    how convert large HEX string to binary array ?
    TEA -- Tiny Encryption Algorithm
    DES
    IAR EWARM Checksum Technical Note
  • 原文地址:https://www.cnblogs.com/wu-song/p/9012581.html
Copyright © 2011-2022 走看看