Php 某些URL太长时无法命中应用程序

Php 某些URL太长时无法命中应用程序,php,apache,Php,Apache,我最近刚刚安装了PHP7.1,在手头的应用程序中遇到了一些问题。似乎一旦URL超过108个字符,请求就不会命中应用程序,就好像它没有正确路由一样。 我认为我缺少一个php.ini设置,它支持这种行为。然而,我还没有找到任何有效的方法。我在其他地方看到有人建议增加或关闭php.ini中的“输出缓冲”,但这并没有起作用 非常感谢任何帮助 以下是htaccess代码: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{

我最近刚刚安装了PHP7.1,在手头的应用程序中遇到了一些问题。似乎一旦URL超过108个字符,请求就不会命中应用程序,就好像它没有正确路由一样。 我认为我缺少一个php.ini设置,它支持这种行为。然而,我还没有找到任何有效的方法。我在其他地方看到有人建议增加或关闭php.ini中的“输出缓冲”,但这并没有起作用

非常感谢任何帮助

以下是htaccess代码:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [QSA,L]
检查apache错误日志,当请求以我描述的方式失败时,我会收到以下错误:

[Tue Oct 16 17:05:38.000118 2018] [core:notice] [pid 77] AH00052: child pid 26760 exit signal Segmentation fault (11)
[Tue Oct 16 17:05:38.000542 2018] [core:notice] [pid 77] AH00052: child pid 26759 exit signal Bus error (10)
[Tue Oct 16 17:05:39.074451 2018] [core:notice] [pid 77] AH00052: child pid 26761 exit signal Bus error (10)
[Tue Oct 16 17:05:40.089130 2018] [core:notice] [pid 77] AH00052: child pid 26763 exit signal Segmentation fault (11)
[Tue Oct 16 17:05:40.092705 2018] [core:notice] [pid 77] AH00052: child pid 26762 exit signal Segmentation fault (11)
[Tue Oct 16 17:05:41.195042 2018] [core:notice] [pid 77] AH00052: child pid 26767 exit signal Segmentation fault (11)
[Tue Oct 16 17:05:41.195139 2018] [core:notice] [pid 77] AH00052: child pid 26766 exit signal Bus error (10)
[Tue Oct 16 17:05:41.195381 2018] [core:notice] [pid 77] AH00052: child pid 26765 exit signal Segmentation fault (11)
[Tue Oct 16 17:05:41.195456 2018] [core:notice] [pid 77] AH00052: child pid 26764 exit signal Segmentation fault (11)
[Tue Oct 16 17:05:42.257230 2018] [core:notice] [pid 77] AH00052: child pid 26768 exit signal Segmentation fault (11)
工作URL应为:

http://photospace.local/admin/content/pages?sdkjfhksdjhfjk=sdfkjnasdasdasdsaasdasdsadadfdfafdgfg
一个不工作的是(注意,这个只多了一个字符):


我通过从Apache的
httpd.conf

我希望它能帮助其他人,因为它太模糊了,只是碰巧解决了


干杯

上述答案不是解决方案,它确实解决了一些情况,但不是所有情况。很多URL模式都失败了,或者在提交表单后发布请求。我以前从未遇到过这个问题(使用上面给出的
.htaccess
配置),直到我彻底安装了最新的
Mac OSX 10.3.6
并升级到
PHP7.2

在摆弄.htaccess配置之后,我发现以下解决了所有问题:

Options +FollowSymlinks
RewriteEngine On

# removes www.
# ------------------------------------------------------------------
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]

# rewrite "domain.com/foo -> domain.com/foo/"
# ------------------------------------------------------------------
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/|#(.*))$
RewriteRule ^(.*)$ /$1/ [R=301,L]

# Yii specific rewrite
# ------------------------------------------------------------------
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php 

#RewriteRule ^(.*)$ index.php [QSA,L] 

共享您的apache配置、.htacces和一些url工作和不工作的示例这是apache施加的标准HTTP限制。通过查询字符串发送大量数据?考虑使用POST。浏览器也有这样的内置限制,它不是大量的数据,只是一个包含109个或更多字符的URL。所以我想这远远低于Apache的限制
Options +FollowSymlinks
RewriteEngine On

# removes www.
# ------------------------------------------------------------------
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]

# rewrite "domain.com/foo -> domain.com/foo/"
# ------------------------------------------------------------------
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/|#(.*))$
RewriteRule ^(.*)$ /$1/ [R=301,L]

# Yii specific rewrite
# ------------------------------------------------------------------
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php 

#RewriteRule ^(.*)$ index.php [QSA,L]