FreePBX WebAdmin broken

So I was attempting to upgrade my PHP version… I can’t recall exactly what I did - want to say tried to upgrade from source, that didn’t work, tried a yum update, same thing. Finally uninstalled via yum, rebuilt from source. Had to configure with apxs2 support. So now PHP is installed, but the FreePBX admin no longer works. I’ve been trying to get a hold of my hosting support, but not having much luck. Near as I can tell I’m running
freepbx.x86_64 2.11.0-4_centos6
Linux version 2.6.32-642.4.2.el6.x86_64 ([email protected]) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-17) (GCC) ) #1 SMP Tue Aug 23 19:58:13 UTC 2016

So after getting a few errors I was able to resolve, when I try to access the web admin for my freepbx, I get
Fatal error : Class ‘DB’ not found in /usr/local/lib/php/DB.php on line 3
Any suggestions?

Thanks!

Which version did you upgrade to?

Also, it seems that your pbx in general is outdated.

I’m on PHP 7.2.10 . Would love to upgrade pbx, but it’s a tad above my pay grade :frowning: Hoping I can get a hold of my hosting provider (it’s actually a friend, he may be out of town for a bit :frowning: )

I don’t think PHP 7 is currently supported on any version of FreePBX.

Oh. What version should I install?

I know that 6.4 is OK (I just did this to support my TimeTrex installation on my commercial PBX).

I couldn’t find 6.4, found 5.6.3.7 which I think is what I have before… Modified httpd.conf, the php info file I created shows Current PHP version: 5.6.37, however I still get
Fatal error : Class ‘DB’ not found in /usr/local/lib/php/DB.php on line 3

FreePBX 13 supports PHP 5.3
FreePBX 14 supports PHP 5.6
FreePBX 15 supports PHP 7.2

You are using some version of FreePBX before 13 as we haven’t used DB in a long time (12 and lower)

1 Like

Is upgrading via CLI fairly straight forward?

According to admin/modules/core/module.xml :

core standard Applications Core 12.0.46 Sangoma Technologies Corporation GPLv3+ http://www.gnu.org/licenses/gpl-3.0.txt no no

Answer ^

I found https://wiki.freepbx.org/plugins/servlet/mobile#content/view/6553680
When I run amportal a ma upgradeall , I get

Fetching FreePBX settings with gen_amp_conf.php…
./amportal: /var/lib/asterisk/bin/gen_amp_conf.php: /usr/bin/php: bad interpreter: No such file or directory

/var/lib/asterisk/bin/freepbx_engine: /var/lib/asterisk/bin/gen_amp_conf.php: /usr/bin/php: bad interpreter: No such file or directory
**** WARNING: ERROR IN CONFIGURATION ****
astrundir in ‘/etc/asterisk’ is set to but the directory
does not exists. Attempting to create it with: 'mkdir -p ’

mkdir: missing operand
Try `mkdir --help’ for more information.
**** ERROR: COULD NOT CREATE ****
Attempt to execute 'mkdir -p ’ failed with an exit code of 1
You must create this directory and the try again.

/var/lib/asterisk/bin/freepbx_engine
exists

php was in a different directory. I copied to /usr/bin , now get

$ sudo ./amportal a ma upgradeall

Please wait…
./amportal: line 49: Fatal: command not found

/var/lib/asterisk/bin/freepbx_engine: line 100: Fatal: command not found
**** WARNING: ERROR IN CONFIGURATION ****
astrundir in ‘/etc/asterisk’ is set to but the directory
does not exists. Attempting to create it with: 'mkdir -p ’

mkdir: missing operand
Try `mkdir --help’ for more information.
**** ERROR: COULD NOT CREATE ****
Attempt to execute 'mkdir -p ’ failed with an exit code of 1
You must create this directory and the try again.

If you can’t run FreePBX to begin with (" Fatal error : Class ‘DB’ not found in /usr/local/lib/php/DB.php on line 3")

What makes you even remotely think you can run the FreePBX upgrader!?!?!

You are using FreePBX 12 on PHP 7.2. This is your issue. Either downgrade PHP to 5.3 or reinstall. Someone (you or someone else) either upgraded PHP without paying attention or installed FreePBX in some convoluted way. But FreePBX 12 won’t run on PHP 7+ at all. Not even to upgrade

Sorry, I should clarify - Freepbx RUNS - as in it’s still ‘working’ but just th eweb interface isn’t.

Let me try 5.3, I’m now on 5.6.3.7.

Asterisk still runs, FreePBX IS the web interface.

1 Like

d’oh sorry, yes… trying to do 4 things at once lol… So I found 5.3.29 - is that suffucient? Still getting the same error. Or do I need an earlier version of 5.3?

Now you need to go out and find a copy of PearDB and install it. Good luck as that was abandoned 2-3 years ago.

Installed - well, installed, tried to run it from browser, get
Warning : Unknown: failed to open stream: Permission denied in Unknown on line 0

Fatal error : Unknown: Failed opening required ‘/var/www/html/DB/DB.php’ (include_path=’.:/usr/local/lib/php’) in Unknown on line 0
Which clued me to look for it, looks like I already had it at
/usr/local/lib/php/

What do I need to do with pear db?

Thanks for all your help :slight_smile:

Do you have any backups? I’d say you should just restore…

Sadly, no :frowning: