Post
Topic
Board Beginners & Help
Re: PHP and bitcoinQT error when connecting via jsonRPC
by
spunkybd
on 21/04/2013, 04:29:38 UTC
The daemon had trouble parsing the json you sent it.

Without a code snippet, I can't help you any more than that.

Code:
/* Configuration variables for the JSON-RPC server */
$rpc_host = 'localhost';
$rpc_port = '8332';
$rpc_user = 'thisuser';
$rpc_pass = 'mypass';


require_once('jsonRPCClient.php');
$bc = new jsonRPCClient('http://' . $rpc_user . ':' . $rpc_pass . '@' . $rpc_host . ':' . $rpc_port);

Also conf:

Code:
# JSON-RPC options (for controlling a running Bitcoin/bitcoind process)
 
 # server=1 tells Bitcoin-QT to accept JSON-RPC commands.
 server=1
 
 # You must set rpcuser and rpcpassword to secure the JSON-RPC api
 rpcuser=thisuser
 rpcpassword=thispass
 
 # How many seconds bitcoin will wait for a complete RPC HTTP request.
 # after the HTTP connection is established.
 rpctimeout=30
 
 # By default, only RPC connections from localhost are allowed.  Specify
 # as many rpcallowip= settings as you like to allow connections from
 # other hosts (and you may use * as a wildcard character):
 #rpcallowip=10.1.1.34
 rpcallowip=127.0.0.1
 rpcallowip=10.1.10.100
 rpcallowip=localhost
 
 # Listen for RPC connections on this TCP port:
 rpcport=8332