The UTHSC IT department requested that we update BNW (Bayesian Network Webserver) to the latest version of PHP.
Begin by identifying the parts that make up the service, i.e.
The following useful links were identified
There was need to update the text editor configs to enable editing of PHP code.
Next was looking at the code. The version of PHP in use is determined by the version of guix in use. I (@fredm) am guessing that the version of guix used to build the BNW container before was `guix (GNU Guix) 9f829da86fceb78cc6fedfd30ee42071d3e402c4`, which has PHP 7.4.14. This is an earlier version than is specified by IT (7.4.25).
fredm@tux02:~/guix-bioinformatics$ guix --version guix (GNU Guix) 9f829da86fceb78cc6fedfd30ee42071d3e402c4 Copyright (C) 2021 the Guix authors License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. fredm@tux02:~/guix-bioinformatics$ guix search php | grep -A1 'name: php' name: php version: 7.4.14
A newer version of guix `guix (GNU Guix) 61428ccf41f21f5ea1e4f1eec722ef9b1efc3a0e` has a more recent version of PHP (8.3.12).
fredm@tux02:~/guix-bioinformatics$ ~/opt/guix-production/bin/guix --version guix (GNU Guix) 61428ccf41f21f5ea1e4f1eec722ef9b1efc3a0e Copyright (C) 2025 the Guix authors License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. fredm@tux02:~/guix-bioinformatics$ ~/opt/guix-production/bin/guix search php | grep -A1 'name: php' name: php version: 8.3.12 -- name: php version: 5.6.40
A way to quickly identify any obvious bugs caused by a migration from PHP 7.4.14 to PHP 8.3.12 was sought. The following tools were identified as possible ways to check:
Unfortunately, none of these are defined in Guix. Instead, a Guix shell was setup for claude code. This was used to go through the code to identify what might need to be updated to ensure the code works with the newer version(s) of PHP.
Claude was used to generate patches, and the patches were manuall reviewed before applying and pushing.
Testing the changes on local dev environment began.
A number of minor and obvious bugs were fixed.
Paths to executable that made assumption of specific system paths (e.g. /usr/bin/dot, /usr/bin/octave, etc) were identified and fixed in a more robust way.
Use of relative paths for executables built as part of BNW leads to silently failing background scripts, i.e. the scripts fail to run due to wrong paths and PHP does not catch and report the failures, leading to failure(s) when the subsequent code attempts to access files it expects to have been created by the scripts but were not. The new issue below was created to track the fixes for this.