I am using Ubuntu 15.04, Apache/2.4.10. I enabled mod_rewrite and mod_proxy_fcgi.
My apache config for fcgi is:
ProxyPassMatch ^/(.+\.(hh|php)(/.*)?)$ fcgi://127.0.0.1:9000/var/www/html/myapp/$1
When I request http://127.0.0.1/index.php it works perfectly
I added a rewrite rule like this:
RewriteRule ^foo index.php?country=de&handle=cleanmaster&offer=3
Now when I request http://127.0.0.1/foo Apache crash with this error:
[pid 4242:tid 140535432255360] AH00051: child pid 4539 exit signal Segmentation fault (11), possible coredump in /tmp/apache2-gdb-dump
If I look at the core dump, this is the stack trace:
Program terminated with signal SIGSEGV, Segmentation fault.
#0 strlen () at ../sysdeps/x86_64/strlen.S:106
warning: Source file is more recent than executable.
106 movdqu (%rax), %xmm12
(gdb) where
#0 strlen () at ../sysdeps/x86_64/strlen.S:106
#1 0x00007fd0f461ed37 in ap_fcgi_encoded_env_len ()
#2 0x00007fd0f03b328d in ?? () from /usr/lib/apache2/modules/mod_proxy_fcgi.so
#3 0x00007fd0f05c0653 in proxy_run_scheme_handler () from /usr/lib/apache2/modules/mod_proxy.so
#4 0x00007fd0f05c161c in ?? () from /usr/lib/apache2/modules/mod_proxy.so
#5 0x00007fd0f46182a0 in ap_run_handler ()
#6 0x00007fd0f46187e9 in ap_invoke_handler ()
#7 0x00007fd0f462dfac in ap_internal_redirect ()
#8 0x00007fd0eff98ea2 in ?? () from /usr/lib/apache2/modules/mod_rewrite.so
#9 0x00007fd0f46182a0 in ap_run_handler ()
#10 0x00007fd0f46187e9 in ap_invoke_handler ()
#11 0x00007fd0f462e682 in ap_process_async_request ()
#12 0x00007fd0f462b1f0 in ?? ()
#13 0x00007fd0f4621b10 in ap_run_process_connection ()
#14 0x00007fd0f09e1b0b in ?? () from /usr/lib/apache2/modules/mod_mpm_event.so
#15 0x00007fd0f3abc6aa in start_thread (arg=0x7fd0e77fe700) at pthread_create.c:333
#16 0x00007fd0f37f1eed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
BTW if I disable fcgi, rewrite rule works fine and the correct file gets shown. In this case it just don't go through fcgi and of course source file gets downloaded. I believe something goes wrong with mix of rewrite and fcgi