【发布时间】:2014-11-13 12:51:31
【问题描述】:
我正在尝试使用 PHP 中的 Bitcoind JSON-RPC API 来使用以下代码控制我的钱包。
<?php
echo "hello";
require_once 'jsonRPCClient.php';
$bitcoin = new jsonRPCClient('http://bitcoinrpc:password@127.0.0.1:8332/');
echo "Received: ".$bitcoin->getnewaddress()."\n";
?>
只打印出hello,甚至没有打印出Recieved:。你可以查看here.
我的 bitcoin.conf:
rpcuser=bitcoinrpc
rpcpassword=password
alertnotify=echo %s | mail -s "Bitcoin Alert" admin@foo.com
server=1
到底发生了什么,我该如何解决?
【问题讨论】:
-
您是否启用了错误报告?看起来您的脚本在包含的
jsonRPCClient.php文件中的某处中止,或者因为 PHP 没有找到它。 -
@Lukas 我试图使用JSON-RPC PHP Library,但没有“安装”它。谢谢