Bitcoin Forum
November 22, 2017, 05:18:27 PM *
News: Latest stable version of Bitcoin Core: 0.15.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Electrum PHP Commands  (Read 694 times)
KocaEfe
Full Member
***
Offline Offline

Activity: 175

★777Coin.com★ Fun BTC Casino!


View Profile
February 23, 2017, 09:38:05 AM
 #1

Hello everyone.. I want use, electrum daemon on my php pages without blockchain...

Electrum daemon and rpc port works fine... I use this electrum php lib; (My electrum version 2.6.4)
https://github.com/shaman/php-electrum-library

and my php page is this;

Code:
<?php
require_once'electrum.php';

$electrum = new Electrum('127.0.0.1'7777);

$response $electrum->getbalance();

echo 
"$response";
?>


But page is empty.. I see only white page. Please help me... Thanks.

▲▼▲▼▲▼▲▼  No.1 Bitcoin Binary Options and Double Dice  ▲▼▲▼▲▼▲▼
████████████████████████████████  sec◔nds trade  ████████████████████████████████
↑↓ Instant Bets ↑↓ Flexible 1~720 minutes Expiry time ↑↓ Highest Reward 190% ↑↓ 16 Assets [btc, forex, gold, 1% edge double dice] ↑↓
1511371107
Hero Member
*
Offline Offline

Posts: 1511371107

View Profile Personal Message (Offline)

Ignore
1511371107
Reply with quote  #2

1511371107
Report to moderator
1511371107
Hero Member
*
Offline Offline

Posts: 1511371107

View Profile Personal Message (Offline)

Ignore
1511371107
Reply with quote  #2

1511371107
Report to moderator
Join ICO Now A blockchain platform for effective freelancing
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1511371107
Hero Member
*
Offline Offline

Posts: 1511371107

View Profile Personal Message (Offline)

Ignore
1511371107
Reply with quote  #2

1511371107
Report to moderator
altcoinhosting2
Member
**
Offline Offline

Activity: 110


View Profile
February 23, 2017, 09:46:03 AM
 #2

Hello everyone.. I want use, electrum daemon on my php pages without blockchain...

Electrum daemon and rpc port works fine... I use this electrum php lib; (My electrum version 2.6.4)
https://github.com/shaman/php-electrum-library

and my php page is this;

Code:
<?php
require_once'electrum.php';

$electrum = new Electrum('127.0.0.1'7777);

$response $electrum->getbalance();

echo 
"$response";
?>


But page is empty.. I see only white page. Please help me... Thanks.

I'm not familiar with the php-electrum-library, but your first order of business would be to:

1) create a testpage to see if php works fine... For example test.php
Code:
<?php
phpinfo
();
?>

If this page doesn't load properly, there is a problem with your lamp setup to begin with...

2) look at your server logs, the apache errorlogs are usually located in /var/log/apache2/error.log
Tail the errorlog and reload the page
Code:
tail -f /var/log/apache2/error.log
if you see errors appearing, they should point you towards what's wrong, if you have no clue => google is your friend

3) see what's in your variable, there are 2 ways of doing this:
Code:
<?php
require_once'electrum.php';

$electrum = new Electrum('127.0.0.1'7777);

$response $electrum->getbalance();

echo 
"<pre>";
print_r($response);
echo 
"</pre>";
?>


or

Code:
var_dump($response);

BTW, did you verify the prereqs?
Quote
electrum => 2.6.4
php => 5.6
php-curl
php-json

██████████████████████▔|▔▔|      LEDGER WALLETSecond factorMalware Proof
████████████████████▔|▔▔|
██████████████████████|▔▔| ◀◀ Smartcard based Hardware Wallet - Worldwide Shipping
KocaEfe
Full Member
***
Offline Offline

Activity: 175

★777Coin.com★ Fun BTC Casino!


View Profile
February 23, 2017, 09:51:46 AM
 #3

Thx buddy! fixed! Smiley) with php5-curl dependencines...

▲▼▲▼▲▼▲▼  No.1 Bitcoin Binary Options and Double Dice  ▲▼▲▼▲▼▲▼
████████████████████████████████  sec◔nds trade  ████████████████████████████████
↑↓ Instant Bets ↑↓ Flexible 1~720 minutes Expiry time ↑↓ Highest Reward 190% ↑↓ 16 Assets [btc, forex, gold, 1% edge double dice] ↑↓
altcoinhosting2
Member
**
Offline Offline

Activity: 110


View Profile
February 23, 2017, 09:58:29 AM
 #4

Php is works fine..

But "nginx" my error.log is this;

Code:
2017/02/23 09:33:24 [error] 776#0: *5 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Call to undefined function curl_init() in /var/www/html/electrum.php on line 39" while reading response header from upstream, client: 192.168.2.203, server: your_server_ip, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "192.168.2.158"

I'm working on raspberry pi and connect with ssh... Please helpp  Huh Undecided


Seems like
Code:
sudo apt-get install php5-curl

might do the trick Wink (at least, it might solve this issue... There is no guarantee that everything else will work, but you'll have to tackle one problem at a time)
(sollution = untested, i don't have a rPi running nginx, so i cannot test out the sollution)

don't forget to either restart nginx/php-fpm, or just to plain restart your box just to be sure...

██████████████████████▔|▔▔|      LEDGER WALLETSecond factorMalware Proof
████████████████████▔|▔▔|
██████████████████████|▔▔| ◀◀ Smartcard based Hardware Wallet - Worldwide Shipping
KocaEfe
Full Member
***
Offline Offline

Activity: 175

★777Coin.com★ Fun BTC Casino!


View Profile
February 23, 2017, 11:08:46 AM
 #5

How i generate new addresses? like bitcoind (generatenewaddress)...

▲▼▲▼▲▼▲▼  No.1 Bitcoin Binary Options and Double Dice  ▲▼▲▼▲▼▲▼
████████████████████████████████  sec◔nds trade  ████████████████████████████████
↑↓ Instant Bets ↑↓ Flexible 1~720 minutes Expiry time ↑↓ Highest Reward 190% ↑↓ 16 Assets [btc, forex, gold, 1% edge double dice] ↑↓
altcoinhosting2
Member
**
Offline Offline

Activity: 110


View Profile
February 23, 2017, 02:43:31 PM
 #6

How i generate new addresses? like bitcoind (generatenewaddress)...

I'm not familiar with this library, nor with the electrum json-rpc api (i always use the core implementation's json-rpc api), but judging from this page:
http://docs.electrum.org/en/latest/merchant.html#create-a-signed-payment-request

I suppose it has to be something like this:
$response = $electrum->addrequest(1, "test");

This is completely untested (i don't have an electrum daemon running, nor an nginx stack, nor a rPi,... So i can only point towards what i think might be a sollution... It's up to you to test and debug).

██████████████████████▔|▔▔|      LEDGER WALLETSecond factorMalware Proof
████████████████████▔|▔▔|
██████████████████████|▔▔| ◀◀ Smartcard based Hardware Wallet - Worldwide Shipping
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!