Php JSON RPC库无法连接到比特币?
我可以使用命令行连接到Bitcoin,并且进程正在使用适当的端口运行,但是当我在使用JSON-RPC库(我使用PHP开发者简介作为代码)后尝试通过XAMPP运行它时,它会给我以下错误,我不知道为什么:Php JSON RPC库无法连接到比特币?,php,json,json-rpc,bitcoin,Php,Json,Json Rpc,Bitcoin,我可以使用命令行连接到Bitcoin,并且进程正在使用适当的端口运行,但是当我在使用JSON-RPC库(我使用PHP开发者简介作为代码)后尝试通过XAMPP运行它时,它会给我以下错误,我不知道为什么: Warning: fopen(): Failed to enable crypto in /opt/lampp/htdocs/bitcoins/jsonRPCClient.php on line 132 Warning: fopen(https://...@127.0.0.1:8332/):
Warning: fopen(): Failed to enable crypto in /opt/lampp/htdocs/bitcoins/jsonRPCClient.php on line 132
Warning: fopen(https://...@127.0.0.1:8332/): failed to open stream: operation failed in /opt/lampp/htdocs/bitcoins/jsonRPCClient.php on line 132
Fatal error: Uncaught exception 'Exception' with message 'Unable to connect to https://user:password
@127.0.0.1:8332/' in /opt/lampp/htdocs/bitcoins/jsonRPCClient.php:140
Stack trace:
#0 /opt/lampp/htdocs/bitcoins/testServer.php(7): jsonRPCClient->__call('getinfo', Array)
#1 /opt/lampp/htdocs/bitcoins/testServer.php(7): jsonRPCClient->getinfo()
#2 {main}
thrown in /opt/lampp/htdocs/bitcoins/jsonRPCClient.php on line 140
代码如下:(我们尝试在http和https之间切换,但仍然不起作用)
require_once'jsonRPCClient.php';
$bitcoin=新的jsonRPCClient('https://user:password@127.0.0.1:8332/');
回音“\n”;
打印($bitcoin->getinfo());
回声“;
请分享您的bitcoin.conf的内容,这些内容可以在~/.bitcoin(linux操作系统上)下找到
require_once 'jsonRPCClient.php';
$bitcoin = new jsonRPCClient('https://user:password@127.0.0.1:8332/');
echo "<pre>\n";
print_r($bitcoin->getinfo());
echo "</pre>";