Bug 58834

Summary: ModRewrite fails with .php urls and FPM on Apache 2.4.10
Product: Apache httpd-2 Reporter: gher <gherardi.riccardo>
Component: mod_rewriteAssignee: Apache HTTPD Bugs Mailing List <bugs>
Status: NEW ---    
Severity: normal    
Priority: P2    
Version: 2.4.10   
Target Milestone: ---   
Hardware: Other   
OS: Linux   

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
</IfModule>

  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

</IfModule>
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 ;-)