have an electrum wallet on my linux server. Am trying to run commands to control it through php.
Electrum essentially says, use curl and get a json returned.
http://docs.electrum.org/en/latest/merchant.html Last section
Below is what I have so far it is not working.
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://myuserame:mypassword==@serverip:7777");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "{\"id\":\"curltext\",\"method\":\"getbalance\",\"params\":[]}");
$result = curl_exec($ch);
if (curl_errno($ch)) { echo 'Error:' . curl_error($ch); }
curl_close ($ch);
var_dump($result);
?>
Returns:
Error:bool(false)