I connected to the database on the remote asterisk server from the FOP server.
Edit the /var/www/html/fop2/config.php on your FOP server and use the DB config info from /etc/freepbx.conf that is on your Asterisk server. Restart FOP2 service.
You will need to make sure the user that is in your /etc/freepbx.conf has permissions from your FOP server host/ip. The * db user that is in your /etc/freepbx.conf will probably be restricted to the localhost by default.