I'm very unhappy with the way php-fpm handles requests.
There isn't even some SCRIPT_FILENAME in the RFC for CGI, an that's the only standard I found to handle the requests.
Actually what you are doing with PATH_TRANSLATED is supposed to translate to the path, which is broken by media wikis, as they use the PATH_INFO to find the ressource, not some script.
In the original CGI context, the PATH_INFO is passed to the CGI binary to specify some ressource argument. So actually
SCRIPT_NAME ~ argv0
PATH_INFO ~ argv1
in command context.
Conclusion: We should rewrite php-fpm to obey the rfc3875 CGI standard.
Having SCRIPT_NAME pointing to /something.php, must translate to
CWD/something.php
CWD is the working directory where php-fpm is started (or configured to change to).
In case of chroot CWD = "".
In any case the SCRIPT_NAME php script can be found with ./SCRIPT_NAME, from the CWD. So the undocumented not standardized SCRIPT_FILENAME should vanish! It breaks the CGI standard.