<blockquote>
  <p>Working JSON-RPC from php. Reamined Ubuntu server configration causing
  problems.</p>
</blockquote>

<p>Main thing ,allow 8332 port using <code>sudo ufw allow 8332</code></p>

<p>Easybitcoin.php based on cURL. So install <code>apt-get install php5-curl</code></p>

<p>Following post helped: </p>

<p><a href="https://bitcoin.stackexchange.com/questions/51022/json-rpc-call-from-webpage-to-bitcoin-core?rq=1">JSON RPC call from webpage to Bitcoin Core</a></p>

CC BY-SA 3.0
2018-03-19T07:08:00.400Z
2018-03-19T07:08:00.400Z
Vishal Dalve
<p><code>getinfo</code> was removed from Bitcoin Core 0.16. Use <code>getblockchaininfo</code>, <code>getnetworkinfo</code>, <code>getmininginfo</code>, or <code>getwalletinfo</code> depending on what you actually need. A mapping of each <code>getinfo</code> field to its replacement can be found here: <a href="https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-0.14.0.md#getinfo-deprecated" rel="nofollow noreferrer">https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-0.14.0.md#getinfo-deprecated</a></p>

CC BY-SA 3.0
2018-03-19T04:32:05.100Z
so https://github.com/aceat64/EasyBitcoin-PHP this repo is useless then? we are unable to use it? if yes then is any alternative? Thanks
Vishal Dalve
CC BY-SA 3.0
2018-03-19T04:37:18.473Z
You can just replace the `getinfo()` calls to the appropriate replacement.
Ava Chow
CC BY-SA 3.0
2018-03-19T06:19:13.650Z
Please see updated question. if you got any clue, kindly tell me where I mistaken. Thanks for your valuable time.
Vishal Dalve
CC BY-SA 3.0
2018-03-18T21:14:59.857Z
2018-03-18T21:14:59.857Z
Ava Chow
<blockquote>
  <p><strong>Trying to implement Bitcoin JSON-RPC using Digital Ocean Ubuntu using bitcoin version 16.</strong></p>
</blockquote>

<p>Here is my php code</p>

<pre><code>&lt;?php

require_once('easybitcoin.php');

$bitcoin = new Bitcoin('someusername', 'somepassword');

print_r($bitcoin);

//print_r($bitcoin-&gt;getwalletinfo()());

$getinfo = $bitcoin-&gt;getblockchaininfo();

print_r($getinfo);

?&gt;
</code></pre>

<blockquote>
  <p><strong>Output</strong></p>
  
  <p>Bitcoin Object ( [username:Bitcoin:private] => someusername
  [password:Bitcoin:private] => somepassword [proto:Bitcoin:private] =>
  http [host:Bitcoin:private] => localhost [port:Bitcoin:private] =>
  8332 [url:Bitcoin:private] => [CACertificate:Bitcoin:private] =>
  [status] => [error] => [raw_response] => [response] =>
  [id:Bitcoin:private] => 0 )</p>
  
  <p><strong>Giving error HTTP ERROR 500</strong></p>
</blockquote>

<p>I'm not much php aware, I tried enabling error reporting in php.ini but not getting errorlog.</p>

<p>Here is my <strong>bitcoin.conf</strong></p>

<pre><code>rpcuser=someusername
rpcpassword=somepassword
prune=600
maxconnections=12
maxuploadtarget=20
daemon=1
server=1
keypool=10000
</code></pre>

<p>Bitcoin server is fully synced in prune mode, up &amp; running.bitcoin-cli properly working. If anyone have new working php-bitcoind examples, please share on vd30992@gmail.com</p>

<p><a href="https://i.sstatic.net/TaKIf.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/TaKIf.png" alt="working bitcoin-cli"></a></p>

<blockquote>
  <p>Thanks for any help.</p>
</blockquote>

<bitcoin-core><bitcoind><json-rpc><php><bitcoin-cli>
PHP functions not working in bitcoin JSON-RPC version 16 (bitcoin-cli is working properly)
Vishal Dalve
# PHP functions not working in bitcoin JSON-RPC version 16 (bitcoin-cli is working properly)

(Asked by: username_0 on 2018-03-18)

Trying to implement Bitcoin JSON-RPC using Digital Ocean Ubuntu using bitcoin version 16.

Here is my php code
getwalletinfo()());

$getinfo = $bitcoin->getblockchaininfo();

print_r($getinfo);

?>


Output
Bitcoin Object ( [username:Bitcoin:private] => someusername
  [password:Bitcoin:private] => somepassword [proto:Bitcoin:private] =>
  http [host:Bitcoin:private] => localhost [port:Bitcoin:private] =>
  8332 [url:Bitcoin:private] => [CACertificate:Bitcoin:private] =>
  [status] => [error] => [raw_response] => [response] =>
  [id:Bitcoin:private] => 0 )
Giving error HTTP ERROR 500

I'm not much php aware, I tried enabling error reporting in php.ini but not getting errorlog.
Here is my bitcoin.conf
rpcuser=someusername
rpcpassword=somepassword
prune=600
maxconnections=12
maxuploadtarget=20
daemon=1
server=1
keypool=10000

Bitcoin server is fully synced in prune mode, up & running.bitcoin-cli properly working. If anyone have new working php-bitcoind examples, please share on vd30992@gmail.com


Thanks for any help.

**Tags:** bitcoin-core, bitcoind, json-rpc, php, bitcoin-cli


---

## 2 answers

### Answer by username_0 on 2018-03-19. Score: 0 | Accepted answer

> Working JSON-RPC from php. Reamined Ubuntu server configration causing
> problems.

Main thing ,allow 8332 port using `sudo ufw allow 8332`

Easybitcoin.php based on cURL. So install `apt-get install php5-curl`

Following post helped:

[JSON RPC call from webpage to Bitcoin Core](https://bitcoin.stackexchange.com/questions/51022/json-rpc-call-from-webpage-to-bitcoin-core?rq=1)


---

### Answer by username_1 on 2018-03-18. Score: 1

`getinfo` was removed from Bitcoin Core 0.16. Use `getblockchaininfo`, `getnetworkinfo`, `getmininginfo`, or `getwalletinfo` depending on what you actually need. A mapping of each `getinfo` field to its replacement can be found here: <https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-0.14.0.md#getinfo-deprecated>

> **Comments:**
> **username_0**: so https://github.com/aceat64/EasyBitcoin-PHP this repo is useless then? we are unable to use it? if yes then is any alternative? Thanks  
> **username_1**: You can just replace the `getinfo()` calls to the appropriate replacement.  
> **username_0**: Please see updated question. if you got any clue, kindly tell me where I mistaken. Thanks for your valuable time.  

---

