0

I am interested in creating a php application that uses bitcoin. I've understood everything so far except for what I am supposed to supply as these variables:

$btc_connect = array("user" => "youusername",             // RPC Username
        "pass" =>   "yourpassword",                   // RPC Password
        "host" =>   "127.0.0.1",                      // RPC Hostname/IP
        "port" =>   8321);                            // RPC Port

$mybtc = new jsonRPCClient("http://{$btc_connect['user']}:{$btc_connect['pass']}@{$btc_connect['host']}:{$btc_connect['port']}");

I have searched everywhere, including the bitcoin.org website to try to find out how to set this up. Is there something I have to install on my server?

I have a webserver and can set things up if only I knew how to get started with this.

Amy Neville
  • 10,067
  • 13
  • 58
  • 94
  • You have to install the bitcoin daemon on your server. See https://en.bitcoin.it/wiki/PHP_developer_intro – Barmar Apr 14 '13 at 03:51

1 Answers1

3

You're supposed to set up a bitcoind daemon on a server. Then, you set up a bitcoin.conf file (location depends on your OS) where you have the lines:

rpcuser=someusernamehere
rpcpassword=somepasswordhere
rpcport=8332

rpcport defaults to 8332 so you can leave it out. You'd run the bitcoind with flag daemon. The other two lines give you the user and pass. Then in that array you'd fill in the selected user/pass, the IP of the server and 8332 as the port.

see here: https://en.bitcoin.it/wiki/Running_Bitcoin#Bitcoin.conf_Configuration_File

derp
  • 219
  • 1
  • 7
  • I'm starting to understand. Is there any way to run bitcoind from a dedicated web server host? Rather than from my desktop? – Amy Neville Apr 14 '13 at 04:11
  • I run it from a Ubuntu VPS. It doesn't require too much in the way of system resources. But you would need shell access to run it - it isn't something you can throw on a web hosting account. – derp Apr 14 '13 at 05:17