Commit 17479f8
authored
handle apache DocumentRoot cyrillic encoding
When DocumentRoot contains cyrillic characters like
DocumentRoot /home/hans/web/cyrillicрф.ratma.net/public_html
and PHP is invoked with SetHandler (*PS not applicable to ProxySetMatch, the problem occurs with SetHandler specifically) like
DocumentRoot /home/hans/web/cyrillicрф.ratma.net/public_html
<FilesMatch \.php$>
SetHandler "proxy:unix:/run/php/php8.3-fpm-cyrillicрф.ratma.net.sock"
</FilesMatch>
then apache will url-encode the cyrillic characters before sending it to fpm, so env_script_filename will contain
/home/hans/web/cyrillic%D1%80%D1%84.ratma.net/public_html/index.php
and we need to url-decode it to
/home/hans/web/cyrillicрф.ratma.net/public_html/index.php
otherwise we hit that
zlog(ZLOG_DEBUG, "Primary script unknown");
SG(sapi_headers).http_response_code = 404;
PUTS("File not found.\n");
error code path.1 parent c5d9c7d commit 17479f8
1 file changed
+10
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1035 | 1035 | | |
1036 | 1036 | | |
1037 | 1037 | | |
1038 | | - | |
| 1038 | + | |
| 1039 | + | |
1039 | 1040 | | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
1040 | 1049 | | |
1041 | 1050 | | |
1042 | 1051 | | |
| |||
0 commit comments