FreePBX 13 backup module PHP fatal errors

I have a long-running FreePBX 13 (built from source) & Asterisk 16 combo that I rarely look over. So it was recently I spotted fatal errors on the dashboard e.g. Reload failed because retrieve_conf encountered an error: 255

In my apache2 logs I see a lot of FreePBX PHP errors, and since the PHP modules have been routinely updated as part of maintaining the Debian server, I figured there’s a good chance this was the source. I thought it’d be wise to go to the current FreePBX 15, but this is where I got into trouble - I cannot successfully backup FreePBX 13:

Apache2 logs:

[Tue Feb 01 23:18:35.057079 2022] [php7:error] [pid 1803] [client 192.168.46.210:40648] PHP Fatal error:  Uncaught Error: Cannot use string offset as an array in /var/www/html/admin/libraries/BMO/LoadConfig.class.php:317\nStack trace:\n#0 /var/www/html/admin/libraries/BMO/LoadConfig.class.php(81): FreePBX\\LoadConfig->explodeConfig()\n#1 /var/www/html/admin/libraries/BMO/LoadConfig.class.php(41): FreePBX\\LoadConfig->loadConfig()\n#2 /var/www/html/admin/libraries/BMO/Self_Helper.class.php(115): FreePBX\\LoadConfig->__construct()\n#3 /var/www/html/admin/libraries/BMO/Self_Helper.class.php(51): FreePBX\\Self_Helper->autoLoad()\n#4 /var/www/html/admin/modules/music/Music.class.php(752): FreePBX\\Self_Helper->__call()\n#5 /var/www/html/admin/modules/music/Music.class.php(38): FreePBX\\modules\\Music->loadMoHConfig()\n#6 /var/www/html/admin/libraries/BMO/Self_Helper.class.php(125): FreePBX\\modules\\Music->__construct()\n#7 /var/www/html/admin/libraries/BMO/Self_Helper.class.php(61): FreePBX\\Self_Helper->autoLoad()\n#8 /var/www/html/admin/libraries/modulefunctions.class.php(2469): FreePBX\\Self_Helper->injectClass()\n#9 /var/www/html/admi in /var/www/html/admin/libraries/BMO/LoadConfig.class.php on line 317, referer: http://pomerium.romanus.ca/admin/config.php?display=modules

HP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; modulelist has a deprecated constructor in /var/www/html/admin/libraries/modulelist.class.php on line 3
PHP Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/admin/modules/backup/functions.inc/s3.php on line 2359
PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; xml2Array has a deprecated constructor in /var/www/html/admin/libraries/xml2Array.class.php on line 24
Initializing Backup 1
Backup Lock acquired!
Running pre-backup hooks...
Adding items...
Building manifest...
PHP Fatal error: Uncaught Error: Cannot use string offset as an array in /var/www/html/admin/modules/backup/functions.inc/class.backup.php:672
Stack trace:
#0 /var/www/html/admin/modules/backup/bin/backup.php(58): FreePBX\modules\Backup\Backup->build_manifest()
#1 {main}
thrown in /var/www/html/admin/modules/backup/functions.inc/class.backup.php on line 672

So… I don’t want to toss a perfectly-working Asterisk 16 into the trash by a fresh install. If the backup module is busted, I don’t mind doing backups of directories and mysql database… but I am not certain what exactly I should be backing up, and I don’t know if I could simply non-module copy them back into a FreePBX 15 install.

You need PHP 5.6

1 Like

Yup, that’s probably it - Debian quietly upgraded and deprecated 5.6 when I last did security patches. Unfortunately, untangling that mess isn’t quite as simple as I’d hoped, even though I can re-install 5.6 from the sury repositories. Is there any option of simply jumping up to FreePBX 16 (where supposedly php7 works-ish) without trashing my asterisk config? I am loath to touch anything since the current config is working, but I’m in a stage where the only way I could administer it is by hand-editing the asterisk config files directly.

(Update: I did eventually untangle the mess by scrutinizing the apache2 error logs and installing the necessary php5.6 modules, so I can at least administer the system, but the question above is still worth answering, if anyone has a good answer).

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.