A
A
Anatoly Shipitsyn2017-02-01 20:56:24
PHP
Anatoly Shipitsyn, 2017-02-01 20:56:24

Why is SCRIPT_NAME not passed correctly to php-fpm from apache with mod_proxy_fcgi module?

When transferring one site, a problem was discovered, one of the urls stopped working and started to return
File not found.
All requests to google describe only a solution for nginx.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anatoly Shipitsyn, 2017-02-01
@norguhtar

As it turned out, the problem is in this bug
https://bz.apache.org/bugzilla/show_bug.cgi?id=40102
In some cases, it breaks SCRIPT_NAME which is used by php-fpm to select a file. As you can see, he is already 11 years old and no one is in a hurry to correct him. Yes, 2.4 also has this bug.
How is it fixed? Elementary if .htaccess has
RewriteRule ^apps(.*)$ /apps.php/$1 [L]
then change it to
RewriteRule ^apps(.*)$ /apps.php [L]
And everything starts working as if nothing did not happen. The URL data, if anything, is taken from the REQUEST_URI where they are sent correctly.
PS Why am I posting this? For an article on Habré, this question is too small. And just right for a toaster.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question