]> mop.ddnsfree.com - git repositories - brisk.git/commit
error.php and doc_download.php: $DOCUMENT_ROOT was never set
authorMatteo Nastasi <nastasi@alternativeoutput.it>
Sun, 13 Sep 2026 10:33:39 +0000 (12:33 +0200)
committerMatteo Nastasi <nastasi@alternativeoutput.it>
Sun, 13 Sep 2026 10:33:39 +0000 (12:33 +0200)
commit80368ea76eeab95768c5fb0a8fe9954806e92985
tree6fe7b1fdb793a26fe9a79e9eefd8343902de9473
parent4069be762db7cddb83c94c5d9f8f1dbf727ce813
error.php and doc_download.php: $DOCUMENT_ROOT was never set

Both scripts include Obj/brisk.phh, which on line 94 does

    require_once("$DOCUMENT_ROOT/Etc/".BRISK_CONF);

but neither of them set $DOCUMENT_ROOT. The path collapsed to
"/Etc/brisk_spu.conf.pho", the require failed and the page answered 500.

This is not a consequence of the port: the git history shows that
doc_download.php never had that line in two commits, and error.php does not
mention it at all. INSTALL.sh substitutes $DOCUMENT_ROOT only in spush/*.ph*
and donometer.php (line 445), not in these two.

NOTE: in the working copy doc_download.php carried a local fix that was never
committed, with the path written by hand
($DOCUMENT_ROOT="/home/nastasi/web"). Since INSTALL.sh distributes from the
working copy and not from git, that is probably what runs in production: a
fix that existed on one disk only and would have disappeared at the first
clone onto a new machine. This commit replaces it with the portable form.

Used the scheme already present in usermgmt.php, mailmgr.php,
briskin5/statadm.php and the others, which derive the value from $_SERVER: it
works both with mod_php and with php-fpm and does not depend on a hardcoded
path. $G_base = "" was added to doc_download.php too, which brisk.phh:95 needs
and which was missing.

Found by handing the pages not given to the daemon over to php-fpm, which
under apache were served by mod_php: both answered 500. After the fix: 200.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014M1jiEq9cHdE5SE5j6vFuE
web/doc_download.php
web/error.php