Bug 58834 - ModRewrite fails with .php urls and FPM on Apache 2.4.10
Summary: ModRewrite fails with .php urls and FPM on Apache 2.4.10
Status: NEW
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_rewrite (show other bugs)
Version: 2.4.10
Hardware: Other Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
Depends on:
Reported: 2016-01-11 20:34 UTC by gher
Modified: 2016-01-17 19:52 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description gher 2016-01-11 20:34:43 UTC
S.O. is Debian 8.2 jessie
Apache version: 2.4.10 (Debian)

I have a main domain (www.sample.com) and a subdomain (news.sample.com).

Running Apache with FPM the following .htaccess rule in news.domain.com fails:

RewriteRule ^folder/(.*)\.php$ http://www.domain.com/folder/$1.php [L,R=301]

The output is: "File not found."
The error in log is: AH01071: Got error 'Primary script unknown\n'

The same occurs for other directives envolving .php files such as http error remapping:
ErrorDocument 404 /error/http.php?e=404
I get always "File not found." and same AH01071 error.

Everything works fine instead with FastCGI.
Comment 1 Eric Covener 2016-01-11 21:03:00 UTC
What's the fcgi configuration?
Comment 2 gher 2016-01-12 07:06:12 UTC
I think you mean fcgid.conf:

<IfModule mod_fcgid.c>

<IfModule !mod_fastcgi.c>
    AddHandler fcgid-script fcg fcgi fpl

  FcgidIPCDir /var/lib/apache2/fcgid/sock
  FcgidProcessTableFile /var/lib/apache2/fcgid/shm

  FcgidIdleTimeout 40
  FcgidProcessLifeTime 30
  FcgidMaxProcesses 20
  FcgidMaxProcessesPerClass 8
  FcgidMinProcessesPerClass 0
  FcgidConnectTimeout 30
  FcgidIOTimeout 45
  FcgidInitialEnv RAILS_ENV production
  FcgidIdleScanInterval 10

Comment 3 gher 2016-01-12 18:32:25 UTC
I forgot an important information:
The configuration is handled by Plesk v12.5.30
Comment 4 gher 2016-01-17 19:52:51 UTC
The last patch of Plesk broke completely PHP-FPM so anything works anymore....
I installed again a new server and switched to FastCGI mode.
(and hope it will be really fast ;-)