Skip to content

Commit 7b10889

Browse files
authored
Update avoid-php-fpm-reloading.md (#4027)
I've also been setting `DOCUMENT_ROOT` to also include the fix. I'm sure `SCRIPT_FILENAME` is enough in most cases, but also setting `DOCUMENT_ROOT` would ensure the expectation in all scenarios.
1 parent bd1b91d commit 7b10889

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/avoid-php-fpm-reloading.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,16 @@ _current_ in the path, your server configured incorrectly.
2727

2828
## Fix for Nginx
2929

30-
Nginx has special variable `$realpath_root`, use it to set up `SCRIPT_FILENAME`:
30+
Nginx has special variable `$realpath_root`, use it to set up `SCRIPT_FILENAME` and `DOCUMENT_ROOT`:
3131

3232
```diff
3333
location ~ \.php$ {
3434
include fastcgi_params;
3535
fastcgi_pass unix:/var/run/php/php-fpm.sock;
3636
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
3737
+ fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
38+
- fastcgi_param DOCUMENT_ROOT $document_root;
39+
+ fastcgi_param DOCUMENT_ROOT $realpath_root;
3840
}
3941
```
4042

0 commit comments

Comments
 (0)