我在使用 jsonRPCClient 在我的 vps ubuntu 上获取信息比特币时遇到问题,我不知道如何解决它。
<?php
require_once 'jsonRPCClient.php';
$bitcoin = new jsonRPCClient('http://user:password@127.0.0.1:8332/');
echo "<pre>\n";
print_r($bitcoin->getinfo());
echo "</pre>";
?>
我的配置:
server=1
rpcuser=username
rpcpassword=pass123
rpcallowip=127.0.0.1
daemon=1
它有错误:
Warning: fopen(http://...@127.0.0.1:8332/): failed to open stream: Connection refused in /var/www/.../jsonRPCClient.php on line 133
Fatal error: Uncaught exception 'Exception' with message 'Unable to connect to http://user:password@127.0.0.1:8332/' in /var/www/.../jsonRPCClient.php:141
Stack trace:
#0 /var/www/.../common.php(15): jsonRPCClient->__call('getinfo', Array)
#1 /var/www/.../common.php(15): jsonRPCClient->getinfo()
#2 /var/www/.../index.php(3): include('/var/www/coinba...')
#3 {main}
thrown in /var/www/.../jsonRPCClient.php on line 141
怎么解决,求大神帮忙!!!