Bitcoin Forum
August 21, 2024, 02:33:51 AM *
News: Latest Bitcoin Core release: 27.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: 为何使用php jsonrpc和bitcoin通信提示404 not found  (Read 949 times)
walf_man (OP)
Member
**
Offline Offline

Activity: 112
Merit: 10


View Profile
April 15, 2013, 03:58:49 PM
 #1

错误代码
Code:
PHP Warning:  fopen(http://...@127.0.0.1:8332/) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
 in D:\test\jsonRPCClient.php on line 132
PHP Fatal error:  Uncaught exception 'Exception' with message 'Unable to connect to http://user:password@127.0.0.1:8332/' in D:\test\jsonRPCClient.php:140
Stack trace:
#0 D:\test\test.php(8): jsonRPCClient->__call('getreceivedbyla...', Array)
#1 D:\test\test.php(8): jsonRPCClient->getreceivedbylabel('Your Address')
#2 {main}
  thrown in D:\test\jsonRPCClient.php on line 140

我使用的是wiki提供的代码:
Code:
<?php 
 
require_once 'jsonRPCClient.php';
 
  
$bitcoin = new jsonRPCClient('http://user:password@127.0.0.1:8332/');
 
  echo 
"<pre>\n";
  
print_r($bitcoin->getinfo()); echo "\n";
  echo 
"Received: ".$bitcoin->getreceivedbylabel("Your Address")."\n";
  echo 
"</pre>";
?>


bitcoin启动代码
Code:
bitcoind.exe -daemon

C:\Users\Administrator\AppData\Roaming\Bitcoin\bitcoin.conf
Code:
rpcuser=user
rpcpassword=password
rpcport=8332
server=1


请问问题出在哪里呢?
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!