-1

I'm trying to use the Bitcoind JSON-RPC API from PHP to control my wallet using the following code.

<?php 
  echo "hello";

  require_once 'jsonRPCClient.php';

  $bitcoin = new jsonRPCClient('http://bitcoinrpc:password@127.0.0.1:8332/');

  echo "Received: ".$bitcoin->getnewaddress()."\n";

?>

Which just prints out hello and not even Recieved:. You can view it here.

My bitcoin.conf:

rpcuser=bitcoinrpc
rpcpassword=password
alertnotify=echo %s | mail -s "Bitcoin Alert" admin@foo.com
server=1

What is happening exactly and how can I fix it?

MrLore
  • 3,759
  • 2
  • 28
  • 36
cubecubed
  • 228
  • 4
  • 18
  • 1
    Do you have error reporting enabled? It looks like your script aborts somewhere in the included `jsonRPCClient.php` file or because it is not found by PHP. – Lukas Sep 19 '14 at 03:14
  • @Lukas I was trying to use the [JSON-RPC PHP Library](http://jsonrpcphp.org/?page=index&lang=en) but didn't have it "installed". Thanks – cubecubed Sep 20 '14 at 14:52

1 Answers1

0

I forgot to install the JSON-RPC PHP Library. Once installed it worked beautifully.

Please everyone, as a public service announcement I ask all y'all to remember to install your libraries.

cubecubed
  • 228
  • 4
  • 18