Bitcoin Forum
May 07, 2024, 05:24:31 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Bitcoin / Development & Technical Discussion / Can’t connect to bitcoind from web server on: April 15, 2017, 01:38:53 PM
Hello to everybody!
I have a bitcoind daemon running on a VPS server (ocean digital). Everything is set up ok and it is running with no issues!


I put this script in /var/www/html/test_call.php (in same folder with easybitoin.php) in the VPS (ocean digital):
Code:
<?php
require('easybitcoin.php');
$bitcoin = new Bitcoin('ausername''apassword''localhost');
$info $bitcoin->getinfo(); 
print_r($info); 
?>


and everything is OK as I receive something like : Array ( [version] => 140000 [protocolversion] =>



Now, my problem is when I put the script in the Godaddy Web server /public_html/test_call.php (in same folder with easybitoin.php) it gives me a blanc screen. I do that because I don't want my web site run in the same server with the VPS that runs bitcoind (i will add later a SSH tunnel between them). Here is the test_call.php file in GoDaddy:
Code:
<?php
require('easybitcoin.php');
$bitcoin = new Bitcoin('ausername''apassword''IP of VPS Ocean Digital');
$info $bitcoin->getinfo(); 
print_r($info); 
?>



And here is the bitcoin.conf:
Code:
rpcuser=ausername
rpcpassword=apassword
daemon=1
server=1
rpcallowip=the Website IP for GoDaddy
keypool=10000
prune=600
maxuploadtarget=20
maxconnections=16


I also tried opening ports 8332 and 8333 in the VPS (ocean digital) with
Code:
sudo ufw allow
with no result.


I also changed the port in bitcoin config by adding the line
Code:
rpcport=570
and by changing line 3 in test_call.php
Code:
$bitcoin = new Bitcoin('ausername', 'apassword', 'IP of VPS Ocean Digital', '570');



I searched a lot and found a lot of similar issues from other users, but I couldn’t find the solution.
It seems like am doing something wrong and the rpc is not working properly.
Any ideas please?

Thank you
Nick
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!