Title: JSON error, help please Post by: Alex Beckenham on April 25, 2011, 04:31:55 PM Hi,
I've been trying to debug something for 2 hours now, so frustrating. exception 'Exception' with message 'Unable to connect to http://myusername:mypassword@127.0.0.1:8332/' Any reason why it wouldn't be able to connect even though my username and password are correct? It throws this error when I try to do Code: $bitcoin -> sendfrom(PROGRAM_NAME,$pay_out_address,0.01); Also I've double-checked the logs and the 3 args I'm sending to this function are completely valid. Thanks Title: Re: JSON error, help please Post by: fabianhjr on April 25, 2011, 04:43:53 PM Can you please give the full raw error?
Also, a little bit more of your code would help to see how you connected. Title: Re: JSON error, help please Post by: Alex Beckenham on April 25, 2011, 04:54:21 PM The weird thing is I can easily do $bitcoin->validateaddress('biwoejfiwjefiwojeifow'); with no problem; it connects to the wallet and returns valid info.
Code: Array However just a couple of lines after that when I try to do the send it says it can't connect. Code: try { Code: if ($pay_out_address_details['isvalid']==1) { Note the add_to_log statements have been commented out. Title: Re: JSON error, help please Post by: Alex Beckenham on April 25, 2011, 05:28:21 PM Code: Array NFI. I might need to order a new monitor soon coz I'm about to punch this one after 3 hours. Title: Re: JSON error, help please Post by: BioMike on April 25, 2011, 05:31:20 PM My experience with the jsonRPCClient was that it was as buggy as hell. I would look into that (not your code).
Title: Re: JSON error, help please Post by: Alex Beckenham on April 25, 2011, 05:40:59 PM Well, I just tested that... exactly the same server, same daemon, same wallet, different domain name and it was able to send 100% fine.
Code: define('INC','../inc/'); (Username and password are exactly the same in both scripts). I'll try putting this stupido script onto this other domain... Title: Re: JSON error, help please Post by: Alex Beckenham on April 25, 2011, 06:22:06 PM Wow, problem solved after only 4 hours.
Code: $bitcoin->sendfrom('My Site','xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',0.04); //works with literals I really do love programming though, honestly. Tags: PHP, JSON, RPC, Unable to connect, float, string, amount, type cast, error, fubar |