Running Freepbx as www-data

I am having the same problems trying to run with a non-asterisk web user (in my case user is called ‘pbx’). I’ve also tried adding the web user to the asterisk group but this makes no difference as a user isn’t allowed to edit the crontab of another user.

Here is the error I am getting despite both AMPASTERISKWEBGROUP and AMPASTERISKWEBUSER in /etc/amportal.conf being set to ‘pbx’:

[01-Jul-2015 22:09:04 UTC] PHP Fatal error:  Uncaught exception 'Exception' with message 'Trying to edit user asterisk, when I'm running as pbx' in /home/pbx/public_html/admin/libraries/BMO/Cron.class.php:50
Stack trace:
#0 /home/pbx/public_html/admin/libraries/BMO/Self_Helper.class.php(116): Cron->__construct(Object(FreePBX))
#1 /home/pbx/public_html/admin/libraries/BMO/Self_Helper.class.php(36): Self_Helper->autoLoad('Cron')
#2 /home/pbx/public_html/admin/libraries/BMO/FreePBX.class.php(84): Self_Helper->__get('Cron')
#3 /home/pbx/public_html/admin/modules/sipstation/Sipstation.class.php(30): FreePBX::__callStatic('Cron', Array)
#4 /home/pbx/public_html/admin/modules/sipstation/Sipstation.class.php(30): FreePBX::Cron()
#5 /home/pbx/public_html/admin/libraries/BMO/Self_Helper.class.php(116): FreePBX\modules\Sipstation->__construct(Object(OOBE))
#6 /home/pbx/public_html/admin/libraries/BMO/Self_Helper.class.php(60): Self_Helper->autoLoad('Sipstation')
#7 /home/pbx/public_html/admin/libraries/BMO/OOBE.class.php(125): Self_Helper->injectClass('Sipstation' in /home/pbx/public_html/admin/libraries/BMO/Cron.class.php on line 50

Several other users have reported similar problems while trying to run the web interface with anything other than asterisk as the user [put http:// on these as I can’t post links as new user]:

issues.freepbx.org/browse/FREEPBX-2727

The Asterisk service itself is running as asterisk user. FreePBX is 12.0.43 running on Ubuntu 14.04.