Reload failed because FreePBX could not connect to the asterisk manager interface

Hi I am using freepbx v 2.8.1 while doing any changes in configuration and clicking on apply configuration button gives below error:

Reload failed because FreePBX could not connect to the asterisk manager interface.

exit: 0
Checking for PEAR DB…OK
Checking for PEAR Console::Getopt…OK
Checking for /etc/amportal.conf …OK
Bootstrapping /etc/amportal.conf …OK
Parsing /etc/amportal.conf …OK
Parsing /etc/asterisk/asterisk.conf …OK
Connecting to database…OK
Connecting to Asterisk manager interface…OK
Added to globals: ASTETCDIR = /etc/asterisk
Added to globals: ASTMODDIR = /usr/lib/asterisk/modules
Added to globals: ASTVARLIBDIR = /var/lib/asterisk
Added to globals: ASTAGIDIR = /var/lib/asterisk/agi-bin
Added to globals: ASTSPOOLDIR = /var/spool/asterisk
Added to globals: ASTRUNDIR = /var/run/asterisk
Added to globals: ASTLOGDIR = /var/log/asterisk
Added to globals: CWINUSEBUSY = true
Added to globals: AMPMGRUSER = admin
Added to globals: AMPMGRPASS = 111111
Added to globals: AMPDBENGINE = mysql
Added to globals: AMPDBHOST = localhost
Added to globals: AMPDBNAME = asterisk
Added to globals: AMPDBUSER = asteriskuser
Added to globals: AMPDBPASS = 111111
PHP Warning: array_keys(): The first argument should be an array in /var/www/html/admin/extensions.class.php on line 315
PHP Warning: Invalid argument supplied for foreach() in /var/www/html/admin/extensions.class.php on line 315
Notice: no Queues defined
Notice: no Conferences defined
Notice: no Parking Lots defined
Notice: no iax trunks defined
Notice: no AMP Users defined
Please update your modules and reload Asterisk by browsing to your server.

1 error(s) occurred, you should view the notification log on the dashboard or main screen to check for more details.