• Forum has been upgraded, all links, images, etc are as they were. Please see Official Announcements for more information

401 Unauthorized Error

Emin

New member
Hi everyone,

I am trying to connect dashd but it gives an error.

Message: fopen(http ://[email protected]:9998/): failed to open stream: HTTP request failed! HTTP/1.0 401 Unauthorized



When I looked ~/.dash/dash.conf everything is ok.

rpcuser=dashUser
rpcpassword=dashPass
server=1
daemon=1
rpcallowip=127.0.0.1
rpcport=9998
#paytxfee=0.0003


I am running dashd with this command.
/usr/bin/dashd -deamon
Error: Cannot obtain a lock on data directory /root/.dashcore. Dash Core is probably already running.



I am tried with php
jsonRPCClient it gives HTTP request failed! 401 Unauthorized
shell_exec gives no output

Do you have any idea ? It caused headache.


PHP:
            $output        = shell_exec('curl --user dashUser:dashPass --data-binary \'{"jsonrpc": "1.0", "id":"curltest", "method": "getinfo", "params": [] }\' -H \'content-type: text/plain;\' http ://127.0.0.1:9998/');
            $res           = json_decode($output);
            print_r($res);


            $Dash           = new jsonRPCClient("http ://user:[email protected]:9998/");
            $num     = $Dash->getblockcount();
            print_r($num);
 
Looks like you've forgot to restart your `dashd` after you've added `rpcport` option. Stop it via `dash-cli stop` and then start again.
 
I reboot my server but still not works.
I installed dashd again via PPA and everything is ok now. (I had installed manually via wget)

Code:
sudo add-apt-repository ppa:dash.org/dash
sudo apt-get update
sudo apt-get install dashd dash-qt
 
Back
Top