Failure to install FreePBX on Debian 12

Hey folks, good morning/good afternoon,

I’m encountering a lot of errors while trying to install Asterisk, FreePBX, and especially PHP.

I always encounter errors with PHP, I’m following the documentation, but it’s not working.

Does anyone have a detailed step-by-step guide for installation? It’s been 3 days and I haven’t solved the problems, I’ve cleaned up the installation environment and started from scratch about 10 times and nothing…

Thanks in advance.

FreePBX/sng_freepbx_debian_install: FreePBX 17 Installation Script (github.com)

Now, not being able to install PHP on the server isn’t a FreePBX issue it’s a server issue. You should probably provide actual details of your installation, how you are doing it and exactly what errors you are getting.

Here’s the error I get regarding php:

STARTING ASTERISK
Asterisk is already running
root@server:/usr/src/freepbx# ./install -n --dbuser root --dbpass “SQLPa$$w0rd”
Assuming you are Database Root
Checking if SELinux is enabled…Its not (good)!
Reading /etc/asterisk/asterisk.conf…Done
Checking if Asterisk is running and we can talk to it as the ‘asterisk’ user…Yes. Determined Asterisk version to be: 18.22.0
Checking if NodeJS is installed and we can get a version from it…Yes. Determined NodeJS version to be: 18.19.0
Preliminary checks done. Starting FreePBX Installation
Checking if this is a new install…Partial
Database Root installation checking credentials and permissions…Connected!
Initializing FreePBX Settings
Finished initalizing settings
Copying files (this may take a bit)…
20024/20024 [============================] 100%
Done
bin is: /var/lib/asterisk/bin
sbin is: /usr/sbin
Finishing up directory processes…Done!
Running variable replacement…Done
Creating missing #include files…Done
Setting up Asterisk Manager Connection…Done
Running through upgrades…
Checking for upgrades…
No further upgrades necessary
Finished upgrades
Setting FreePBX version to 17.0.15.2…Done
Writing out /etc/amportal.conf…Done
Writing out /etc/freepbx.conf…Done
Chowning directories…
PHP Fatal error: Declaration of Symfony\Component\Translation\TranslatorInterface::getLocale() must be compatible with Symfony\Contracts\Translation\LocaleAwareInterface::getLocale(): string in /var/www/html/admin/libraries/Composer/vendor/symfony/translation/TranslatorInterface.php on line 69
Whoops\Exception\ErrorException: Declaration of Symfony\Component\Translation\TranslatorInterface::getLocale() must be compatible with Symfony\Contracts\Translation\LocaleAwareInterface::getLocale(): string in file /var/www/html/admin/libraries/Composer/vendor/symfony/translation/TranslatorInterface.php on line 69
Stack trace:

  1. Whoops\Exception\ErrorException->() /var/www/html/admin/libraries/Composer/vendor/symfony/translation/TranslatorInterface.php:69
  2. Whoops\Run->handleError() /var/www/html/admin/libraries/Composer/vendor/filp/whoops/src/Whoops/Run.php:510
  3. Whoops\Run->handleShutdown() [internal]:0
    Done
    Installing framework…
    PHP Fatal error: Declaration of Symfony\Component\Translation\TranslatorInterface::getLocale() must be compatible with Symfony\Contracts\Translation\LocaleAwareInterface::getLocale(): string in /var/www/html/admin/libraries/Composer/vendor/symfony/translation/TranslatorInterface.php on line 69
    Whoops\Exception\ErrorException: Declaration of Symfony\Component\Translation\TranslatorInterface::getLocale() must be compatible with Symfony\Contracts\Translation\LocaleAwareInterface::getLocale(): string in file /var/www/html/admin/libraries/Composer/vendor/symfony/translation/TranslatorInterface.php on line 69
    Stack trace:
  4. Whoops\Exception\ErrorException->() /var/www/html/admin/libraries/Composer/vendor/symfony/translation/TranslatorInterface.php:69
  5. Whoops\Run->handleError() /var/www/html/admin/libraries/Composer/vendor/filp/whoops/src/Whoops/Run.php:510
  6. Whoops\Run->handleShutdown() [internal]:0

In Process.php line 272:

The command “‘/usr/sbin/fwconsole’ ‘ma’ ‘install’ ‘framework’” failed.

Exit Code: 255(Unknown error)

Working directory: /usr/src/freepbx

Output:

Error Output:

install [–dbengine DBENGINE] [–dbname DBNAME] [–dbhost DBHOST] [–dbport DBPORT] [–cdrdbname CDRDBNAME] [–dbuser DBUSER] [–dbpass DBPASS] [–user USER] [–group GROUP] [–dev-links] [–skip-install] [–webroot WEBROOT] [–astetcdir ASTETCDIR] [–astmoddir ASTMODDIR] [–astvarlibdir ASTVARLIBDIR] [–astagidir ASTAGIDIR] [–astspooldir ASTSPOOLDIR] [–astrundir ASTRUNDIR] [–astlogdir ASTLOGDIR] [–ampbin AMPBIN] [–ampsbin AMPSBIN] [–ampcgibin AMPCGIBIN] [–ampplayback AMPPLAYBACK] [-r|–rootdb] [-f|–force]

root@server:/usr/src/freepbx# ./install -n --dbuser root --dbpass “Tec9748@”
PHP Fatal error: Uncaught Error: Call to undefined function FreePBX\Install\simplexml_load_file() in /usr/src/freepbx/install:19
Stack trace:
#0 {main}
thrown in /usr/src/freepbx/install on line 19

These are basically the two errors I receive when trying to install freepabx after installing everything requested in the documentation

Remembering, I use Debian 12 on a cloud server, without a graphical interface

what does php -v return? You need 8.2 not 7.4

ls -lasrt /usr/bin/php* for completeness

Do you have a link with installation instructions? I followed one that asked me for php 7.4, it must be an older link, that’s why I’m beating myself up

I gave you the link. FreePBX 17 doesnt use PHP7.4 it uses PHP8.x

If using the script, you should be running it on a fresh minimal install of D12. That means without PHP, MySQL, apache etc. already installed. The script should take care of all that for you.

I ran the script and got this response, I believe that php did not install…

root@server:~# bash /tmp/sng_freepbx_debian_install.sh
2024-03-28 20:49:53 - Starting installation.
2024-03-28 20:49:53 - Starting FreePBX 17 installation process for server Linu x server 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_ 64 GNU/Linux
2024-03-28 20:49:53 - Please refer to the /var/log/pbx/freepbx17-install-2024. 03.28-20.49.53.log to know the process…
2024-03-28 20:49:53 - Making sure installation is sane
2024-03-28 20:50:09 - Setting up default configuration
2024-03-28 20:50:10 - Setting up repositories
2024-03-28 20:50:30 - Setting up Sangoma repository
2024-03-28 20:50:30 - Updating repository
2024-03-28 20:50:35 - Installing required packages
2024-03-28 20:50:35 - Installing redis-server …
2024-03-28 20:50:41 - redis-server installed successfully…
2024-03-28 20:50:41 - Installing libtonezone-dev …
2024-03-28 20:50:43 - libtonezone-dev installed successfully…
2024-03-28 20:50:43 - Installing libpri-dev …
2024-03-28 20:50:45 - libpri-dev installed successfully…
2024-03-28 20:50:46 - Installing ghostscript …
2024-03-28 20:50:54 - ghostscript installed successfully…
2024-03-28 20:50:55 - Installing libtiff-tools …
2024-03-28 20:50:57 - libtiff-tools installed successfully…
2024-03-28 20:50:58 - Installing iptables-persistent …
2024-03-28 20:51:04 - iptables-persistent installed successfully…
2024-03-28 20:51:04 - Installing rsyslog …
2024-03-28 20:51:08 - rsyslog installed successfully…
2024-03-28 20:51:08 - Installing nmap …
2024-03-28 20:51:16 - nmap installed successfully…
2024-03-28 20:51:16 - Installing apache2 …
2024-03-28 20:51:27 - apache2 installed successfully…
2024-03-28 20:51:27 - Installing zip …
2024-03-28 20:51:31 - zip installed successfully…
2024-03-28 20:51:31 - Installing incron …
2024-03-28 20:51:36 - incron installed successfully…
2024-03-28 20:51:36 - Installing chrony …
2024-03-28 20:51:44 - chrony installed successfully…
2024-03-28 20:51:44 - Installing mariadb-server …
2024-03-28 20:52:00 - mariadb-server installed successfully…
2024-03-28 20:52:00 - Installing flite …
2024-03-28 20:52:03 - flite installed successfully…
2024-03-28 20:52:03 - Installing php8.2 …
2024-03-28 20:52:30 - Exiting script

Just start over, you won’t vanquish the windmill easily.

Can you verify that locale is setup.

apt update && apt -y install locales
locale

It should look something like this.

LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

en_US.UTF-8 could also be C.UTF-8 or perhaps some other language.UTF-8.

If it is empty then run the following to set it up.

dpkg-reconfigure locales