It may be redundant at this point, but as no-one has actually explained in detail the cause of the problem, I thought I should do that.
As noted above, ea-apache24-2.4.37 added the following rewrite-rule to the httpd.conf configuration file:
Code:
RewriteCond %{REQUEST_FILENAME} \.php$
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_URI} !-f
RewriteRule (.*) - [H=text/html]
The intent of this rule is to mark non-existent (file-not-found) PHP scripts as text/html, so that they generate precisely the same "Not Found" message as other missing files. (This appears to be the
only purpose of the rule, AFAIK).
Unfortunately, for this rule to work as intended, it would have to be applied AFTER any other URL rewriting.
But as it is in the httpd.conf file, it gets applied FIRST, before any mod_rewrite rules that may be in a .htaccess file. This is the root of the problem.
As an example, suppose you have a URL scheme like this (for various choices of {clientname}):
Code:
www.mywebsite.com/{clientname}/homepage.php
and your .htaccess file internally rewrites it to:
Code:
www.mywebsite.com/homepage.php?client={clientname}
The new rule would check whether a PHP file actually exists at the file-system location:
WEBROOT/{clientname}/homepage.php
when actually it is of course here:
WEBROOT/homepage.php
So, not finding it in a {clientname} subfolder, it marks your homepage.php script to-be-handled as 'text/html'.
This marker persists through all further rewrite rules, and (apparently) causes PHP-FPM (but not other kinds of PHP) to return a "File not found" error.
To properly fix the rule so that it works as intended, it would have to be applied
last, after all other mod_rewrite rules (wherever they are located) have finished. I'm not 100% sure, but I don't think it's possible to insert a mod_rewrite rule into httpd.conf that will behave like that.