I'm trying to control bitcoin daemon with PHP but I am having an issue when trying to connect to it.
I've followed these steps: en.bitcoin (dot) it/wiki/PHP_developer_intro
PHP code:
<?php
require_once 'jsonRPCClient.php';
$bitcoin = new jsonRPCClient('http://user:[email protected]:8332/');
echo "<pre>\n";
print_r($bitcoin->getinfo());
echo "</pre>";
?>
Bitcoind conf:
rpcuser=user
rpcpassword=password
server=1
daemon=1
listen=1
var/log/httpd/error_log:
[Tue Apr 06 15:47:15.403045 2015] [:error] [pid 2293] [client 10.0.0.34:50333] PHP Warning: fopen(http://[email protected]:8332/): failed to open stream: Permission denied in /var/www/html/jsonRPCClient.php on line 132 [Tue Apr 06 15:47:15.410993 2015] [:error] [pid 2293] [client 10.0.0.34:50333] PHP Fatal error: Uncaught exception 'Exception' with message 'Unable to connect to http://user:[email protected]:8332/' in /var/www/html/jsonRPCClient.php:140\nStack trace:\n#0 /var/www/html/bitcoin_get_info.php(15): jsonRPCClient->__call('getinfo', Array)\n#1 /var/www/html/bitcoin_get_info.php(15): jsonRPCClient->getinfo()\n#2 {main}\n thrown in /var/www/html/jsonRPCClient.php on line 1406
Edit:
$ bitcoin-cli getinfo
Works fine, with PHP it doesn't