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
<?php
+$G_base = "";
+
+/* Obj/brisk.phh needs $DOCUMENT_ROOT to find the configuration file under
+ Etc/. With mod_php it was not filled in by itself and this script failed;
+ it is taken from $_SERVER, as usermgmt.php, mailmgr.php and the others
+ already do. */
+foreach (array("HTTP_HOST", "DOCUMENT_ROOT") as $i) {
+ if (isset($_SERVER[$i])) {
+ $$i = $_SERVER[$i];
+ }
+ }
+
require_once("Obj/brisk.phh");
function main()
$G_base = "";
+/* Obj/brisk.phh needs $DOCUMENT_ROOT to find the configuration file under
+ Etc/. With mod_php it was not filled in by itself and this script failed;
+ it is taken from $_SERVER, as usermgmt.php, mailmgr.php and the others
+ already do. */
+foreach (array("HTTP_HOST", "DOCUMENT_ROOT") as $i) {
+ if (isset($_SERVER[$i])) {
+ $$i = $_SERVER[$i];
+ }
+ }
+
require_once("Obj/brisk.phh");
require_once("Obj/user.phh");
require_once("Obj/auth.phh");