FreePBX: Declaration of FreePBX\Database::query() must be compatible with PDO::query

36 Views Asked by At

I want to install FreePBX, follow this step from: https://cloudinfrastructureservices.co.uk/how-to-install-freepbx-on-ubuntu-22-04-23-04/,

With step: ./install -n, I got this error:

root@ip-172-31-23-59:~/asterisk-20.7.0/freepbx# ./install -n
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: 20.7.0
Checking if NodeJS is installed and we can get a version from it...Yes. Determined NodeJS version to be: 12.22.9
Preliminary checks done. Starting FreePBX Installation
Checking if this is a new install...Yes (No /etc/freepbx.conf file detected)
Database Root installation checking credentials and permissions..Connected!
PHP Fatal error:  Declaration of FreePBX\Database::query() must be compatible with PDO::query(string $query, ?int $fetchMode = null, mixed ...$fetchModeArgs): PDOStatement|false in /root/asterisk-20.7.0/freepbx/amp_conf/htdocs/admin/libraries/BMO/Database.class.php on line 240

Can someone help? I am using Ubuntu 22.04.4

1

There are 1 best solutions below

0
arheops On

Most likely it is php-mysql or php-mysqlnd

Not all versions of freepbx are working on all OSes due to different libriaries version.

You have install pre-requests before freepbx install.

For example for Centos 8 it looks like this:

sed -i 's/\(^SELINUX=\).*/\SELINUX=disabled/' /etc/sysconfig/selinux
sed -i 's/\(^SELINUX=\).*/\SELINUX=disabled/' /etc/selinux/config
yum install epel-release -y
yum -y install http://rpms.remirepo.net/enterprise/remi-release-8.rpm
yum-config-manager --enable remi-php
yum install epel-release -y
yum -y update
yum -y groupinstall core base "Development Tools"
dnf config-manager --set-enabled powertools
dnf module switch-to php:7.4
package_list=" lynx mariadb-server mariadb php php-mysql php-mbstring tftp-server "
package_list="$package_list  httpd ncurses-devel sendmail sendmail-cf sox newt-devel libxml2-devel libtiff-devel "
package_list="$package_list    audiofile-devel gtk2-devel subversion kernel-devel git php-process crontabs cronie "
package_list="$package_list    cronie-anacron wget vim php-xml uuid-devel sqlite-devel net-tools gnutls-devel php-pear mysql-connector-odbc "
package_list="$package_list    nodejs php-xml  php-mysql php-mbstring libuuid-devel mariadb-connector-odbc libedit-devel php-pear "
package_list="$package_list    php-gd php-json php-mysqlnd "

yum install --skip-broken -y  $package_list


dnf install php-json

php-pear install Console_Getopt