I answered in another post, fop2settings.db that counts in your setup is the one in /etc/asterisk/fop2, be sure it is owned by asterisk, that asterisk user can write to it, and also modify the pagebs.fop2settings.php page to point to that directory instead of /usr/local/fop2