OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 2027|回复: 0

nginx+thinkphp下解决不支持pathinfo模式

[复制链接]

153

主题

311

帖子

0

精华

高级会员

Rank: 4

积分
673
金钱
673
注册时间
2019-3-26
在线时间
18 小时
发表于 2019-4-24 14:01:20 | 显示全部楼层 |阅读模式

这篇文章主要介绍了nginx+thinkphp下解决不支持pathinfo模式的相关资料,需要的朋友可以参考下
nginx环境问题弄了两天,发现网上很多人的帖子要么复制粘贴,要么就是没有结贴,还自己写一句“哈哈,我自己解决了”之类的,这点我就鄙视这些发帖的同胞了,你说你问题问了,问题解决了也不给个解释。搜索引擎大全还在搜索的前几页,想没想过需要答案的人的感受呢。满心欢喜的去看答案,发现没有结贴。好吧,不多说,进入正题。

我这种方式是不需要将URL_Model改为rewrite/兼容的:

大约第43行,按照下面的对照自己的code进行修改,请注意细节的符号:

location / { root C:/Zend/workspaces; #//这是你自己项目的根目录。 index index.html index.htm index.php; if (!-e KaTeX parse error: Expected '}', got 'EOF' at end of input: … rewrite ^/(.*) /index.php/KaTeX parse error: Expected 'EOF', got '}' at position 17: … break; break; }̲ } 在php的配置中,将lo… 改为 location ~ .php,再次强调,注意细节,这里去掉了$符号,我刚开始也是因为这个原因一直没能解决。

location ~ .php { root C:/Zend/workspaces; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME C:/wnmp/php$fastcgi_script_name; include fastcgi_params; set $path_info “”; set $real_script_name <span class="MathJax" id="MathJax-Element-1-Frame" tabindex="0" data-mathml="fastcgiscriptname;if(      fastcgi_script_name; if (" role="presentation" style="box-sizing: border-box; outline: 0px; display: inline; line-height: normal; word-spacing: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; position: relative;">fastcgiscriptname;if(fastcgi_script_name; if (fastcgis&#8203;criptn&#8203;ame;if(fastcgi_script_name ~ “^(.+?.php)(/.+)$”) { set $real_script_name $1; set $path_info $2; } fastcgi_param SCRIPT_FILENAME <span class="MathJax" id="MathJax-Element-2-Frame" tabindex="0" data-mathml="documentroot      document_root" role="presentation" style="box-sizing: border-box; outline: 0px; display: inline; line-height: normal; word-spacing: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; position: relative;">documentrootdocument_rootdocumentr&#8203;ootreal_script_name; fastcgi_param SCRIPT_NAME $real_script_name; fastcgi_param PATH_INFO KaTeX parse error: Expected 'EOF', got '}' at position 12: path_info; }&#818; 如果仍未解决,在ThinkP…_SERVER[‘SCRIPT_NAME’]);

期间大家可能会遇到500,404的问题,但记住一点,细心就行。只要按照我这个改,基本没什么问题。如果还有问题,欢迎留言咨询。

以上所述就是本文的全部内容了


http://www.iis7.com/c/90/
正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2024-5-29 07:35

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

快速回复 返回顶部 返回列表