I'm trying to get the PHP developer intro
https://en.bitcoin.it/wiki/PHP_developer_intro on a windows machine and keep getting errors.
Warning: fopen(http://...@localhost:8332) [function.fopen]: failed to open stream: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in C:\xampp\htdocs\bitcoin-app\jsonRPCClient.php on line 132
Fatal error: Uncaught exception 'Exception' with message 'Unable to connect to http://user:password@localhost:8332' in C:\xampp\htdocs\bitcoin-app\jsonRPCClient.php:140 Stack trace: #0 [internal function]: jsonRPCClient->__call('getbalance', Array) #1 C:\xampp\htdocs\bitcoin-app\hello.php(4): jsonRPCClient->getbalance() #2 {main} thrown in C:\xampp\htdocs\bitcoin-app\jsonRPCClient.php on line 140
Steps I've taken:
1) downloaded portable bitcoin client from
http://sourceforge.net/projects/bitcoin/files/Bitcoin/bitcoin-0.6.3/bitcoin-0.6.3-win32.zip/download2) imported updated blk0001.dat and blk0002.dat from another pc and let the bitcoin client verify the blockchain. Client is now up to date and running on windows machine.
3) sent 0.1btc to the bitcoin address
4) made a C:\Users\dev\AppData\Roaming\Bitcoin\bitcoin.conf file containing:
server=1
rpcuser=user
rpcpassword=password
rpctimeout=90
rpcallowip=127.0.0.1
rpcport=8332
5) added jsonRPCClient.php in the www folder web accessible
6) index.php code:
<?php
require_once 'jsonRPCClient.php';
$myExample = new jsonRPCClient('http://user:password@localhost:8332');
$myExample->getbalance();
?>
Am I doing anything wrong?