skip to Main Content

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

Answers


  1. Chosen as BEST ANSWER

    I fixed it by removing LoadModule negotiation_module libexec/apache2/mod_negotiation.so from Apache's httpd.conf

    I hope it helps someone else because it is so obscure and just resolved it by chance.

    cheers


  2. 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] 
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search