From: Matteo Nastasi Date: Sun, 13 Sep 2026 10:33:39 +0000 (+0200) Subject: error.php and doc_download.php: $DOCUMENT_ROOT was never set X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=commitdiff_plain;h=80368ea76eeab95768c5fb0a8fe9954806e92985;p=brisk.git 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) Claude-Session: https://claude.ai/code/session_014M1jiEq9cHdE5SE5j6vFuE --- diff --git a/web/doc_download.php b/web/doc_download.php index 9e86ef1..81fff99 100644 --- a/web/doc_download.php +++ b/web/doc_download.php @@ -1,4 +1,16 @@