<p>firstly Setup bitcoin Core API server on your pc.</p>

<p>then install Php-curl for your Apache server.</p>

<p>then Follow Link: <code>en.bitcoin.it/wiki/PHP_developer_intro</code></p>

<p>put api command as function name and if have any Parameters then put in function parameter. i hope it will work.give you result as json format.</p>

<p>Must <code>On</code> your <code>Display Error</code> in <code>php.ini</code> </p>

CC BY-SA 3.0
2015-05-19T15:29:20.353Z
2015-05-19T15:29:20.353Z
Md Shahadat Hossain
<p>i want to build a bitcoin third party server for my client.</p>

<p>but problem is that when i execute "bitcoin-cli" command using php then it didn't give any result.</p>

<p>i used JSONRPCClient. but i didn't find any solution and how to use it can't understand.</p>

<p>here i have to give "user:password@127.0.0.1:8338" . is this my pc user and password??? </p>

<p>do i need bitcoin authentication for this? or give me some suggestion to make it live.</p>

<p>This script doesn't produce any output:</p>

<pre><code>require_once 'jsonRPCClient.php';
$bitcoin = new jsonRPCClient('http://bitcoinrpc:HGySbCZrdHq5BDQH3iwzb3oGZCJX8AfWe2EBQrNg9EvJ@127.0.0.1:8332/');
echo "&lt;pre&gt;";
print_r($bitcoin);
echo "&lt;pre&gt;\n fgfgf";
print_r($bitcoin-&gt;getinfo());
echo "&lt;/pre&gt;";
</code></pre>

CC BY-SA 3.0
2015-05-18T16:13:39.933Z
Sounds like a PHP question. Otherwise, missing details from bitcoin.conf that would help debug this, like is the RPC even set up to service requests from the IP? Is it hosted on the same server?
karimkorun
CC BY-SA 3.0
2015-05-18T16:56:59.467Z
Did you try reading this? https://en.bitcoin.it/wiki/PHP_developer_intro
Nick ODell
CC BY-SA 3.0
2015-05-19T04:23:54.333Z
it's my local server. it's php question.bitcoin.conf has only rpcuser and rpcpassword. how can i start??? @karimkorun------------------------------
i tried developer intro . but i won't understand how and where is the function details, `$bitcoin->getinfo()` ?there is no function details in JSONRPC. if i have to write this function then how i can start?? i need a example of function.. @NickODell
Md Shahadat Hossain
CC BY-SA 3.0
2015-05-19T06:42:19.993Z
@ShahadatHossain The page I linked has several examples. Did you read it, or try any of them?
Nick ODell
CC BY-SA 3.0
2015-05-19T06:51:24.867Z
yes i have read those example before and after this post submit. but where is getinfo details. if it's submit by _call function then it does not give me any output. what should i do now??? @NickODell
Md Shahadat Hossain
CC BY-SA 3.0
2015-05-19T06:53:20.760Z
`require_once 'jsonRPCClient.php';
$bitcoin = new jsonRPCClient('http://bitcoinrpc:HGySbCZrdHq5BDQH3iwzb3oGZCJX8AfWe2EBQrNg9EvJ@127.0.0.1:8332/');
echo "<pre>";
print_r($bitcoin);
echo "<pre>\n fgfgf";
print_r($bitcoin->getinfo());
echo "</pre>";`
Md Shahadat Hossain
CC BY-SA 3.0
2015-05-19T08:28:55.040Z
It doesn't produce *any* output? Not even the `echo "<pre>";`? Does it hang?
Nick ODell
<bitcoind><php><bitcoin-core>
how to execute Ubuntu shell for bitcoind command in php?
Md Shahadat Hossain
# how to execute Ubuntu shell for bitcoind command in php?

(Asked by: username_0 on 2015-05-18)

i want to build a bitcoin third party server for my client.

but problem is that when i execute "bitcoin-cli" command using php then it didn't give any result.

i used JSONRPCClient. but i didn't find any solution and how to use it can't understand.

here i have to give "user:password@127.0.0.1:8338" . is this my pc user and password???

do i need bitcoin authentication for this? or give me some suggestion to make it live.

This script doesn't produce any output:

```
require_once 'jsonRPCClient.php';
$bitcoin = new jsonRPCClient('http://bitcoinrpc:HGySbCZrdHq5BDQH3iwzb3oGZCJX8AfWe2EBQrNg9EvJ@127.0.0.1:8332/');
echo "<pre>";
print_r($bitcoin);
echo "<pre>\n fgfgf";
print_r($bitcoin->getinfo());
echo "</pre>";

```

**Tags:** bitcoind, php, bitcoin-core

> **Comments:**
> **username_1**: Sounds like a PHP question. Otherwise, missing details from bitcoin.conf that would help debug this, like is the RPC even set up to service requests from the IP? Is it hosted on the same server?  
> **username_2**: Did you try reading this? https://en.bitcoin.it/wiki/PHP_developer_intro  
> **username_0**: it's my local server. it's php question.bitcoin.conf has only rpcuser and rpcpassword. how can i start??? @username_1------------------------------ i tried developer intro . but i won't understand how and where is the function details, `$bitcoin->getinfo()` ?there is no function details in JSONRPC. if i have to write this function then how i can start?? i need a example of function.. @username_2  
> **username_2**: @ShahadatHossain The page I linked has several examples. Did you read it, or try any of them?  
> **username_0**: yes i have read those example before and after this post submit. but where is getinfo details. if it's submit by _call function then it does not give me any output. what should i do now??? @username_2  
> **username_0**: `require_once 'jsonRPCClient.php'; $bitcoin = new jsonRPCClient('http://bitcoinrpc:HGySbCZrdHq5BDQH3iwzb3oGZCJX8AfWe2EBQrNg9EvJ@127.0.0.1:8332/'); echo "<pre>"; print_r($bitcoin); echo "<pre>\n fgfgf"; print_r($bitcoin->getinfo()); echo "</pre>";`  
> **username_2**: It doesn't produce *any* output? Not even the `echo "<pre>";`? Does it hang?  

---

## 1 answers

### Answer by username_0 on 2015-05-19. Score: 1

firstly Setup bitcoin Core API server on your pc.

then install Php-curl for your Apache server.

then Follow Link: `en.bitcoin.it/wiki/PHP_developer_intro`

put api command as function name and if have any Parameters then put in function parameter. i hope it will work.give you result as json format.

Must `On` your `Display Error` in `php.ini`


---

