'Website connected to Bitcoin RPC Wrapper on second server (Bitcoin Core) - Purchase fails

I am trying to connect my ecommerce site to enable payments with Bitcoin. When I had the site and Bitcoin Core running on the same server, it worked fine. I now use a second server for the Bitcoin Core and orders are getting the error "Trying to access array offset on valie of type null". Given it worked before, I assume it's the Bitcoin RPC problem.

Is there a problem with my config?

PHP files on 95.XXX.XX.XXX (where the website is stored)

config PHP:

/**
 * RPCWrapper settings
 *
 * Uses data from .environemntConfig file
 */
'bitcoin' => [
    'host' => environemntConfig('BITCOIN_HOST', 'localhost'),
    'username' => environemntConfig('BITCOIN_USERNAME', 'username'),
    'password' => environemntConfig('BITCOIN_PASSWORD', 'password'),
    'port' => environemntConfig('BITCOIND_PORT', 18332),
],

environmentConfig PHP:

BITCOIN_HOST=65.xxx.xx.xxx
BITCOIN_PORT=8332
BITCOIN_USERNAME=MYUSERNAME
BITCOIN_PASSWORD=MYSTRONGPASSWORD!

BITCOIN CORE CONFIG (running on second server: 65.xxx.xx.xxx):

server=1 
testnet=0
rpcuser=MYUSERNAME
rpcpassword=MYSTRONGPASSWORD!
server=1
rpcconnect=127.0.0.1
rpcport=9337

Thanks so much for any help!



Solution 1:[1]

The error was that the rpc ports were not open on the Bitcoin running server.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 MaBo88