windows php下不能请求自己的接口解决
发布日期:2021-11-18 19:17:31 浏览次数:9 分类:技术文章

本文共 1163 字,大约阅读时间需要 3 分钟。

cmd进入php目录下  输入 start php-cgi.exe -b 127.0.0.1:9001 -c php.ini     开启90001端口

 nginx配置指向同一个目录  这样可以解决 windows 请求不到自己接口的问题

server {
        listen       80;
        server_name    server_name ;
        root   "*******";

      location / {

      
               autoindex on;    
            index  index.html index.htm index.php;
            try_files $uri $uri/ /index.php?$query_string;
        }

        error_page   500 502 503 504  /50x.html;

        location = /50x.html {
        }

        location ~ \.php$ {

            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }

        location ~ .*\.(gif|jpg|png|htm|html|css|js|flv|ico|swf)(.*) {

             add_header Cache-Control no-store;
        }

 

}

server {

        listen       80;
        server_name    server_name    ;
        root   "******";
      location / {
   
          autoindex on;    
            index  index.html index.htm;
            try_files $uri $uri/ /index.php?$query_string;
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
        }
        
        
      location ^~ /python/ {
          alias "*****";             //虚拟目录

      }

        location ~ \.php$ {

            fastcgi_pass   127.0.0.1:9001;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }

        location ~ .*\.(gif|jpg|png|htm|html|css|js|flv|ico|swf)(.*) {

             add_header Cache-Control no-store;
        }

 

}

转载地址:https://blog.csdn.net/weixin_39201566/article/details/86150927 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:You can change this value on the server by setting the max_allowed_packet' variable
下一篇:推荐几个好用的代码工具

发表评论

最新留言

不错!
[***.144.177.141]2024年04月24日 07时00分50秒

关于作者

    喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!

推荐文章