Post
Topic
Board Electrum
Re: Electrum PHP Commands
by
altcoinhosting2
on 23/02/2017, 09:46:03 UTC
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:
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:
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:
require_once'electrum.php';

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

$response $electrum->getbalance();

echo 
"
";
print_r($response);
echo 
"
"
;
?>


or

Code:
var_dump($response);

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