doutuan6158 2018-10-16 01:20
浏览 75
已采纳

有些URL太长时间无法访问应用程序

I just recently installed PHP7.1 and run into a few issues with the application at hand. It seems that once the URL exceeds 108 characters the request does not hit the app as if it was not routed correctly. I take it that there is a php.ini setting that I'm missing which is enabling this behaviour. However I was not able to find anything that worked yet. I saw somewhere else people suggesting to increase or turn off 'output_buffering' in php.ini but that did not work.

Any help much appreciated!

Here's the htaccess code:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [QSA,L]

Checking apache error log I get the following error when a request fails in the way I described:

[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)

A working URL would be:

http://photospace.local/admin/content/pages?sdkjfhksdjhfjk=sdfkjnasdasdasdsaasdasdsadadfdfafdgfg

And a non-working one would be (note this one just has one character more):

http://photospace.local/admin/content/pages?sdkjfhksdjhfjk=sdfkjnasdasdasdsaasdasdsadadfdfafdgfaf
  • 写回答

2条回答 默认 最新

  • dongwei7245 2018-10-18 11:12
    关注

    The above answer was not the solution, it did fix some scenarios but not all of them. Plenty of URL patterns were failing, or POST requests after submitting a form. I had never encountered this problem before (with the .htaccess configuration given above) until I did a clean install of the latest Mac OSX 10.3.6 and upgraded to PHP7.2

    After fiddling with .htaccess configurations I found the following which fixed all issues:

    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] 
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 AT89C51控制8位八段数码管显示时钟。
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题