Author

Topic: Php and daemon (Read 797 times)

full member
Activity: 307
Merit: 102
March 03, 2014, 01:27:27 PM
#8
Try using http://jsonrpcphp.org/ instead

https://en.bitcoin.it/wiki/PHP_developer_intro

You'll have to write your own error handling to give adequate errors, though.

FYI, JSON-RPC PHP is a terrible path to point new users/devs down. It uses fopen fopen() and will throw an exception saying "Unable to connect" if it receives a 404 or 500 error from bitcoind, instead of showing the error bitcoind was trying to give you.
newbie
Activity: 28
Merit: 0
February 28, 2014, 07:45:54 AM
#7
...

Code:
require_once('easybitcoin.php');
$bitcoin = new Bitcoin('litecoinrpc','8u1EEMnoeBRTZu3ZYbYtNWSEQPp7QUPSW5z','localhost','8332');
$bitcoin->getinfo();
?>
...

This would produce no output. You would need to do something with it. Just to test, try something like this;

Code:
require_once('easybitcoin.php');
$bitcoin = new Bitcoin('litecoinrpc','8u1EEMnoeBRTZu3ZYbYtNWSEQPp7QUPSW5z','localhost','8332');
$getInfo $bitcoin->getinfo();
var_dump($getInfo);
?>
sr. member
Activity: 437
Merit: 260
balance
February 27, 2014, 11:04:35 PM
#6
Try using http://jsonrpcphp.org/ instead

https://en.bitcoin.it/wiki/PHP_developer_intro

You'll have to write your own error handling to give adequate errors, though.
legendary
Activity: 4228
Merit: 1313
February 27, 2014, 07:42:52 PM
#5
Once you out this live, change the passwords since you posted them here.

I hope that's not his real pass...  Grin

I would hope not, but figured better to be safe.  ;-)
sr. member
Activity: 333
Merit: 250
Commander of the Hodl Legions
February 27, 2014, 07:32:32 PM
#4
Once you out this live, change the passwords since you posted them here.

I hope that's not his real pass...  Grin
legendary
Activity: 4228
Merit: 1313
February 27, 2014, 07:04:18 PM
#3
Once you out this live, change the passwords since you posted them here.
legendary
Activity: 3682
Merit: 1580
February 27, 2014, 06:59:08 PM
#2
Did you try echoing the last line:

echo $bitcoin->getinfo();
newbie
Activity: 13
Merit: 0
February 27, 2014, 03:58:14 PM
#1
Hi all i need to run litecoind and bitcoind with php in localhost (sorry for my little english  Grin)

Iam use this litecoin.conf

Code:
server=1
daemon=1
rpcuser=litecoinrpc
rpcpassword=8u1EEMnoeBRTZu3ZYbYtNWSEQPp7QUPSW5z
rpcport=8332

And this class https://github.com/aceat64/EasyBitcoin-PHP/blob/master/easybitcoin.php

And in my index i have

Code:
require_once('easybitcoin.php');
$bitcoin = new Bitcoin('litecoinrpc','8u1EEMnoeBRTZu3ZYbYtNWSEQPp7QUPSW5z','localhost','8332');
$bitcoin->getinfo();
?>

But not work and in my cmd.exe its ok

Code:
c:\Program Files\Litecoin\daemon>litecoind getinfo
{
    "version" : 80601,
    "protocolversion" : 70002,
    "walletversion" : 60000,
    "balance" : 0.00000000,
    "blocks" : 36119,
    "timeoffset" : -1,
    "connections" : 8,
    "proxy" : "",
    "difficulty" : 0.63768610,
    "testnet" : false,
    "keypoololdest" : 1388892634,
    "keypoolsize" : 101,
    "paytxfee" : 0.00000000,
    "mininput" : 0.00001000,
    "errors" : ""
}

Thanks for all  Smiley
Jump to: