FreePBX on Ubuntu 20.04 + 18.04
This text is part of a users guide and there is an index page to look at.

Be aware!
2021-10-07 FreePBX is not compatible with the latest version of php!

Important is php7.2, node and npm.
  1. https://linuxize.com/post/how-to-install-node-js-on-ubuntu-20-04/
  2. $ sudo apt update
  3. sudo apt install nodejs npm

$ sudo -s
Continue as root.

Step 5 - Install FreePBX
https://www.atlantic.net/vps-hosting/how-to-install-asterisk-and-freepbx-on-ubuntu-20-04/
Go on, from here. At this step, the issue with PHP is described.

root@Asterisk:~# ./install -n
"Checking if SELinux is enabled... It's not! (Good!)
Reading /etc/asterisk/asterisk.conf...Error!
Unable to read /etc/asterisk/asterisk.conf or it was missing a directories section"


https://community.freepbx.org/t/solved-asterisk-16-and-freepbx-14-error-unable-to-read-etc-asterisk-asterisk-conf-or-it-was-missing-a-directories-section/53968/2

Asterisk Error from the enclosed installer-files
Look for solution: $ sudo cp /etc/asterisk/asterisk.conf.old /etc/asterisk/asterisk.conf

See below how to change the content of this file.
File from the installer. Installing will not work. Content is wrong. It shall be as follow...
Correct content:
root@Asterisk:~# cat /etc/asterisk/asterisk.conf

[directories](!)
astetcdir => /etc/asterisk
astmoddir => /usr/lib/asterisk/modules
astvarlibdir => /var/lib/asterisk
astdbdir => /var/lib/asterisk
astkeydir => /var/lib/asterisk
astdatadir => /var/lib/asterisk
astagidir => /var/lib/asterisk/agi-bin
astspooldir => /var/spool/asterisk
astrundir => /var/run/asterisk
astlogdir => /var/log/asterisk
astsbindir => /usr/sbin

[options]
;verbose = 3
;debug = 3
;refdebug = yes ; Enable reference count debug logging.
;alwaysfork = yes ; Same as -F at startup.
;nofork = yes ; Same as -f at startup.
;quiet = yes ; Same as -q at startup.
;timestamp = yes ; Same as -T at startup.
;execincludes = yes ; Support #exec in config files.
;console = yes ; Run as console (same as -c at startup).
;highpriority = yes ; Run realtime priority (same as -p at
; startup).
;initcrypto = yes ; Initialize crypto keys (same as -i at
; startup).
;nocolor = yes ; Disable console colors.
;dontwarn = yes ; Disable some warnings.
;dumpcore = yes ; Dump core on crash (same as -g at startup).
;languageprefix = yes ; Use the new sound prefix path syntax.
;systemname = my_system_name ; Prefix uniqueid with a system name for
; Global uniqueness issues.
;autosystemname = yes ; Automatically set systemname to hostname,
; uses 'localhost' on failure, or systemname if
; set.
;mindtmfduration = 80 ; Set minimum DTMF duration in ms (default 80 ms)
; If we get shorter DTMF messages, these will be
; changed to the minimum duration
;maxcalls = 10 ; Maximum amount of calls allowed.
;maxload = 0.9 ; Asterisk stops accepting new calls if the
; load average exceed this limit.
;maxfiles = 1000 ; Maximum amount of openfiles.
;minmemfree = 1 ; In MBs, Asterisk stops accepting new calls if
; the amount of free memory falls below this
; watermark.
;cache_media_frames = yes ; Cache media frames for performance
; Disable this option to help track down media frame
; mismanagement when using valgrind or MALLOC_DEBUG.
; The cache gets in the way of determining if the
; frame is used after being freed and who freed it.
; NOTE: This option has no effect when Asterisk is
; compiled with the LOW_MEMORY compile time option
; enabled because the cache code does not exist.
; Default yes
;cache_record_files = yes ; Cache recorded sound files to another
; directory during recording.
;record_cache_dir = /tmp ; Specify cache directory (used in conjunction
; with cache_record_files).
;transmit_silence = yes ; Transmit silence while a channel is in a
; waiting state, a recording only state, or
; when DTMF is being generated. Note that the
; silence internally is generated in raw signed
; linear format. This means that it must be
; transcoded into the native format of the
; channel before it can be sent to the device.
; It is for this reason that this is optional,
; as it may result in requiring a temporary
; codec translation path for a channel that may
; not otherwise require one.
;transcode_via_sln = yes ; Build transcode paths via SLINEAR, instead of
; directly.
;runuser = asterisk ; The user to run as.
;rungroup = asterisk ; The group to run as.
;lightbackground = yes ; If your terminal is set for a light-colored
; background.
;forceblackbackground = yes ; Force the background of the terminal to be
; black, in order for terminal colors to show
; up properly.
;defaultlanguage = en ; Default language
documentation_language = en_US ; Set the language you want documentation
; displayed in. Value is in the same format as
; locale names.
;hideconnect = yes ; Hide messages displayed when a remote console
; connects and disconnects.
;lockconfdir = no ; Protect the directory containing the
; configuration files (/etc/asterisk) with a
; lock.
;stdexten = gosub ; How to invoke the extensions.conf stdexten.
; macro - Invoke the stdexten using a macro as
; done by legacy Asterisk versions.
; gosub - Invoke the stdexten using a gosub as
; documented in extensions.conf.sample.
; Default gosub.
;live_dangerously = no ; Enable the execution of 'dangerous' dialplan
; functions from external sources (AMI,
; etc.) These functions (such as SHELL) are
; considered dangerous because they can allow
; privilege escalation.
; Default no
;entityid=00:11:22:33:44:55 ; Entity ID.
; This is in the form of a MAC address.
; It should be universally unique.
; It must be unique between servers communicating
; with a protocol that uses this value.
; This is currently is used by DUNDi and
; Exchanging Device and Mailbox State
; using protocols: XMPP, Corosync and PJSIP.
;rtp_use_dynamic = yes ; When set to "yes" RTP dynamic payload types
; are assigned dynamically per RTP instance vs.
; allowing Asterisk to globally initialize them
; to pre-designated numbers (defaults to "yes").
;rtp_pt_dynamic = 35 ; Normally the Dynamic RTP Payload Type numbers
; are 96-127, which allow just 32 formats. The
; starting point 35 enables the range 35-63 and
; allows 29 additional formats. When you use
; more than 32 formats in the dynamic range and
; calls are not accepted by a remote
; implementation, please report this and go
; back to value 96.

; Changing the following lines may compromise your security.
;[files]
;astctlpermissions = 0660
;astctlowner = root
;astctlgroup = apache
;astctl = asterisk.ctl

https://linuxize.com/post/how-to-install-node-js-on-ubuntu-20-04/

$ sudo apt update
$ sudo apt install nodejs npm


jakob@sip:~$ nodejs --version
v10.19.0
jakob@sip:~$ npm --version
6.14.4
jakob@sip:~$

Up & Go! :-)
I never registered the software. It works anyway.
Below will be solved installing npm. https://linuxize.com/post/how-to-install-node-js-on-ubuntu-20-04/

Expected output: 5-7 minutes of wait... ("Apply config" will load on log off -- log on.)
UCP = User Control Panel
pm2 = Process Management

Install User Control Panel, UCP
UCP depends on Process Management, Pm2.

  • root@sip:~$ fwconsole ma upgradeall
  • root@sip:~$ fwconsole reload


root@pangolin:~# help fwconsole ma
  • Show Help commands.
[Exception (404)]
Unable to locate the FreePBX BMO Class 'Pm2'A required module might be disabled or uninstalled. Recommended steps (run from the CLI): 1) fwconsole ma install pm2
2) fwconsole ma enable pm2
Recommended steps (Run from the CLI)
  • fwconsole ma install pm2
  • fwconsole ma enable pm2

In case anyone else runs into this same issue, the solution in my case was to run the following commands:
rm -Rf /home/asterisk/{.npm,.npmrc,.node-gyp,.package_cache}
rm -Rf /var/www/html/admin/modules/pm2/node/node_modules
fwconsole ma downloadinstall pm2
pm2 then successfully installed.
Thanks!

This text is part of a users guide and there is an index page to look at.
You can write to me at the FreePBX forum, Civilpolisen.
This site was made on Tilda — a website builder that helps to create a website without any code
Create a website