Hello! I had a raspberry pi with freepbx 15 installed and decided to do upgrade because I needed to install some drivers for my non-chan dongle which might work not good on 15th version. I can’t now exactly explain how I eventually upgraded, because I faced many issues, like installing php 7.4, when the system after its installation thinks that you still have only php 7.0, like impossibility to install proper linux-headers (eventually I installed them from .deb from raspberry archive), need to downgrade libssl to 1.1.1d, etc. It’s upgraded with errors from web ui. Then I repeated the same using fwconsole. And also repeated following this guide, starting from Compile and install Asterisk:
https://wiki.freepbx.org/display/FOP/Installing+FreePBX+16+on+Debian+10.9
During the process, by some moment web ui had worked, I even noticed that it’s version seems to be upgraded (different style of icons, buttons, etc). But after full upgrade, http:/raspbx(or its ip) webpage doesn’t load and logs showed that apache2 faced 500 internal server error. Also I had some problems with fwconsole and returned it to work by restarting some services like mysql and apache2 (I will write the exact commands below).
So, now when the device is rebooted, there is no connection to the http://raspbx (at all, no apache2 service is running). Fwconsole also is down, running it causes following exceptions:
root@raspbx:/home/asterisk# fwconsole ma list
Exception: SQLSTATE[HY000] [2002] Connection refused::SQLSTATE[HY000] [2002] Connection refused in file /var/www/html/admin/libraries/utility.functions.php on line 120
Caused by
PDOException: SQLSTATE[HY000] [2002] Connection refused in file /var/www/html/admin/libraries/BMO/Database.class.php on line 144
Stack trace:
1. Exception->() /var/www/html/admin/libraries/utility.functions.php:120
2. die_freepbx() /var/www/html/admin/libraries/BMO/Database.class.php:149
3. PDOException->() /var/www/html/admin/libraries/BMO/Database.class.php:144
4. PDO->__construct() /var/www/html/admin/libraries/BMO/Database.class.php:144
5. FreePBX\Database->__construct() /var/www/html/admin/libraries/BMO/FreePBX.class.php:71
6. FreePBX->__construct() /var/www/html/admin/bootstrap.php:144
7. require_once() /etc/freepbx.conf:10
8. include_once() /var/lib/asterisk/bin/fwconsole:12
But, restarting some services as I mentioned before:
systemctl stop freepbx.service
systemctl stop apache2.service
systemctl stop mysql.service
systemctl start mysql.service
systemctl start apache2.service
fwconsole start
systemctl start freepbx.service
seems fixing fwconsole:
root@raspbx:/home/asterisk# systemctl stop freepbx.service
root@raspbx:/home/asterisk# systemctl stop apache2.service
root@raspbx:/home/asterisk# systemctl stop mysql.service
root@raspbx:~# systemctl start mysql.service
root@raspbx:~# systemctl start apache2.service
root@raspbx:~# fwconsole start
Running FreePBX startup...
Taking too long? Customize the chown command, See http://wiki.freepbx.org/display/FOP/FreePBX+Chown+Conf
Setting Permissions...
Setting base permissions...Done in 10 seconds
Setting specific permissions...
18190 [============================]
Finished setting permissions
Starting Asterisk...
[============================] 4 secs
Asterisk Started
Running Asterisk post from Core module
Starting Core FastAGI Server...
[>---------------------------] 2 secs
Started Core FastAGI Server. PID is 23329
Running Asterisk post from Ucp module
Starting UCP Node Server...
[>---------------------------] 3 secs
Started UCP Node Server. PID is 23476
root@raspbx:~# systemctl start freepbx.service
Here are the modules installed in the system:
root@raspbx:~# fwconsole ma list
No repos specified, using: [standard] from last GUI settings
+------------------+------------+-----------------------------------+------------+
| Module | Version | Status | License |
+------------------+------------+-----------------------------------+------------+
| amd | 16.0.1 | Enabled | GPLv3+ |
| announcement | 16.0.4 | Enabled | GPLv3+ |
| api | 16.0.4.8 | Enabled | AGPLv3+ |
| arimanager | 16.0.5 | Enabled | GPLv3+ |
| asteriskinfo | 16.0.5 | Enabled | GPLv3+ |
| backup | 16.0.50.8 | Enabled | GPLv3+ |
| blacklist | 16.0.5 | Enabled | GPLv3+ |
| builtin | | Enabled | |
| bulkhandler | 16.0.5 | Enabled | GPLv3+ |
| calendar | 16.0.6 | Enabled | GPLv3+ |
| callforward | 16.0.5 | Enabled | AGPLv3+ |
| callrecording | 16.0.9 | Enabled | AGPLv3+ |
| callwaiting | 16.0.5 | Enabled | GPLv3+ |
| cdr | 16.0.14 | Enabled | GPLv3+ |
| cel | 16.0.5 | Enabled | GPLv3+ |
| certman | 16.0.19 | Enabled | AGPLv3+ |
| cidlookup | 16.0.5 | Enabled | GPLv3+ |
| conferences | 16.0.6 | Enabled | GPLv3+ |
| contactmanager | 16.0.16 | Enabled | GPLv3+ |
| core | 16.0.56.20 | Enabled | GPLv3+ |
| customappsreg | 16.0.3 | Enabled | GPLv3+ |
| cxpanel | 16.0.2 | Enabled | GPLv3 |
| dashboard | 16.0.8 | Enabled | AGPLv3+ |
| daynight | 16.0.1 | Enabled | GPLv3+ |
| directory | 16.0.1 | Enabled | GPLv3+ |
| donotdisturb | 16.0.3 | Enabled | GPLv3+ |
| fax | 16.0.4 | Enabled | GPLv3+ |
| featurecodeadmin | 16.0.1 | Enabled | GPLv3+ |
| filestore | 16.0.10.7 | Enabled | AGPLv3 |
| findmefollow | 16.0.10 | Enabled | GPLv3+ |
| framework | 16.0.10.43 | Enabled | GPLv2+ |
| hotelwakeup | 16.0.1 | Enabled | GPLv2 |
| iaxsettings | 16.0.1 | Enabled | AGPLv3 |
| infoservices | 16.0.2 | Enabled | GPLv2+ |
| ivr | 16.0.3 | Enabled | GPLv3+ |
| logfiles | 16.0.2 | Enabled | GPLv3+ |
| manager | 16.0.9 | Enabled | GPLv2+ |
| music | 16.0.1 | Enabled | GPLv3+ |
| outroutemsg | 16.0.1 | Enabled | GPLv3+ |
| paging | 16.0.8 | Enabled | GPLv3+ |
| parking | 16.0.2 | Enabled | GPLv3+ |
| pinsets | 16.0.6 | Enabled | GPLv3+ |
| pm2 | 16.0.5 | Enabled | AGPLv3+ |
| presencestate | 16.0.1 | Enabled | GPLv3+ |
| printextensions | 16.0.1 | Enabled | GPLv3+ |
| queues | 16.0.14 | Enabled | GPLv2+ |
| recordings | 16.0.5 | Enabled | GPLv3+ |
| restapi | 13.0.21.2 | Enabled | AGPLv3 |
| ringgroups | 16.0.7 | Enabled | GPLv3+ |
| setcid | 16.0.3 | Enabled | GPLv3+ |
| sipsettings | 16.0.16 | Enabled | AGPLv3+ |
| sms | 16.0.4 | Disabled | Commercial |
| soundlang | 16.0.6 | Enabled | GPLv3+ |
| timeconditions | 16.0.8 | Enabled | GPLv3+ |
| ttsengines | 16.0.3 | Enabled | AGPLv3 |
| ucp | 16.0.16 | Enabled | AGPLv3+ |
| userman | 16.0.25.18 | Enabled | AGPLv3+ |
| vmblast | 16.0.4 | Enabled | GPLv3+ |
| voicemail | 16.0.29 | Enabled | GPLv3+ |
| weakpasswords | 16.0.1 | Enabled | GPLv3+ |
| webrtc | 16.0.10 | Enabled | GPLv3+ |
| xmpp | | Not Installed (Locally available) | AGPLv3 |
+------------------+------------+-----------------------------------+------------+
Now, if I type http://raspbx in a browser, it will show nothing, blank page. When http://raspbx/admin/config.php# is typed, some php code is shown with this suspicious place in the middle:
//FREEI-918 - if the uploaded file's size exceeds php's post_max_size, PHP drops //the _POST and _FILES values and continues with the request. There is no error value //to properly know what happened. Meeting this set of conditions is enough evidence //to assume module upload from Module Admin failed due to the file being too large. //The page_content is being overwritten to display an error and option to try again, //instead of going back to the admin dashboard/index if ((preg_match('/config.php\?display=modules&action=upload/', $_SERVER['HTTP_REFERER']) || preg_match('/config.php\?display=updates&action=upload/', $_SERVER['HTTP_REFERER'])) && empty($_FILES) && empty($_POST) && $_REQUEST['display'] === 'index' && $_SERVER['CONTENT_LENGTH'] > 0) { $postMaxSize = ini_get('post_max_size'); $page_content = '
' . _("There was an error uploading the module tar ball due to its size being greater than post_max_size {") . $postMaxSize . '}.
'. _("Please host the file and use the \"Download (From Web) option\", or ssh to your FreePBX system and use \"fwconsole ma downloadinstall [url]\" to install the module from a URL.") . "
" . _("For further help, please contact") . " " . _("Sangoma Support") . "." . '
'; }
Logs of apache2 show:
[Sat Dec 11 00:34:19.503381 2021] [mpm_prefork:notice] [pid 4085] AH00163: Apache/2.4.38 (Raspbian) configured -- resuming normal operations
[Sat Dec 11 00:34:19.503564 2021] [core:notice] [pid 4085] AH00094: Command line: '/usr/sbin/apache2'
***
[Sat Dec 11 01:27:00.540457 2021] [authz_core:error] [pid 4090] [client 10.6.0.2:44714] AH01630: client denied by server configuration: /var/www/html/admin/index.cgi
[Sat Dec 11 01:27:00.540559 2021] [authz_core:error] [pid 4090] [client 10.6.0.2:44714] AH01630: client denied by server configuration: /var/www/html/admin/index.pl
[Sat Dec 11 01:27:00.728057 2021] [:error] [pid 4090] [client 10.6.0.2:44714] PHP Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE) in /var/www/html/admin/libraries/Composer/vendor/symfony/string/Resources/functions.php on line 14
***
[Sat Dec 11 03:04:13.877534 2021] [mpm_prefork:notice] [pid 1137] AH00169: caught SIGTERM, shutting down
[Sat Dec 11 03:38:39.872863 2021] [mpm_prefork:notice] [pid 3159] AH00163: Apache/2.4.38 (Raspbian) configured -- resuming normal operations
[Sat Dec 11 03:38:39.876054 2021] [core:notice] [pid 3159] AH00094: Command line: '/usr/sbin/apache2'
[Sat Dec 11 03:40:11.781334 2021] [mpm_prefork:notice] [pid 3159] AH00169: caught SIGTERM, shutting down
[Sat Dec 11 20:34:21.347563 2021] [mpm_prefork:notice] [pid 22950] AH00163: Apache/2.4.38 (Raspbian) configured -- resuming normal operations
[Sat Dec 11 20:34:21.351007 2021] [core:notice] [pid 22950] AH00094: Command line: '/usr/sbin/apache2'
Errors were yesterday. They gone after I seems following the mentioned 16 version installation guide deleted completely web server’s directory:
rm -rf /var/www/html
So, what does community think about all of that? Is it possible to fix the web ui? If not, do you think it’s possible to do the trunk, extension, outbound and inbound routes using command line only? I have my access to the device only over ssh/vpn, can’t re-flash it or ask someone to do it for me(