Freepbx will not come up after restart

I had Distro 5.211.65-6 running for a considerable time until I had a power problem and the server restarted. Now when I try to enter the gui I get the following:

DB Error: connect failed
Trace Back
/var/www/html/admin/libraries/db_connect.php:71 die_freepbx()
[0]: DB Error: connect failed

/var/www/html/admin/bootstrap.php:85 require_once()
[0]: /var/www/html/admin/libraries/db_connect.php

/etc/freepbx.conf:9 require_once()
[0]: /var/www/html/admin/bootstrap.php

/var/www/html/admin/config.php:99 include_once()
[0]: /etc/freepbx.conf

I can log in as root on the linux command line and when I try an amportal restart I get the following:

[[email protected] ~]# amportal restart

Fetching FreePBX settings with gen_amp_conf.php…
/usr/local/sbin/amportal: line 49: [FATAL]: command not found

/var/lib/asterisk/bin/freepbx_engine: line 98: [FATAL]: command not found
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.
Attempt to execute 'mkdir -p ’ failed with an exit code of 1
You must create this directory and the try again.

Would be very grateful if someone could give me some pointers on troubleshooting/fixing this. I am not adverse to paid support but would first like to try myself so I will understand the problem better and improve my knowledge.

Thanks in advance.

This is corrected in the next release. Basically a stale lock file. I would recommend updating to the next version at a minimum and probably best to update through stable.

Try to read this and then follow given instructions. Keep your FreePBX Distro up to date.

Great Guys - That fixed it - Thanks very much indeed for your prompt assistance - I feel rather ashamed I did not do my homework before posting! Thanks again.