Author

Topic: PHP developer intro on Windows server errors and setup (Read 2396 times)

hero member
Activity: 504
Merit: 500
Everything seems right, did you restart bitcoin after making the bitcoin.conf?

oh, but $myExample->getbalance(); should do something, maybe
$output = $myExample->getbalance();
echo $output;
hero member
Activity: 905
Merit: 1001
i think there is no daemon for windows?
you have downloaded the bitcoin client which has no RPC interface.. but i am not 100% sure about this.

eitherway.. why do you want to use a windows server as bitcoin wallet server???
legendary
Activity: 1102
Merit: 1014
You're early in this so I don't feel bad recommending an Ubuntu or debian server instead.

For your machine, check that you don't have a firewall blocking 8332. Netstat can be used to verify that bitcoind has bound to that port.
full member
Activity: 179
Merit: 100
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.

Code:
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/download
2) 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:

Code:
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:

Code:
require_once 'jsonRPCClient.php';
$myExample = new jsonRPCClient('http://user:password@localhost:8332');
$myExample->getbalance();
?>

Am I doing anything wrong?
Jump to: