How to use HD-WALLET-DERIVE in .php file?












-1















I want to use commands from the hd-wallet-derive command tool in my website.



For example I run this in Ubuntu terminal and it works fine:



$ ./hd-wallet-derive.php -g --key=xprv9tyUQV64JT5qs3RSTJkXCWKMyUgoQp7F3hA1xzG6ZGu6u6Q9VMNjGr67Lctvy5P8oyaYAL9CAWrUE9i6GoNMKUga5biW6Hx4tws2six3b9c --path=m/1 --cols=all --includeroot --numderive=3


But how can I use this code in my PHP file and get output?



For example if I click on a button in my PHP page, the below command run?










share|improve this question

























  • please specify what works fine means. Does this include providing some output, or you need to just run those commands?

    – YakovL
    Nov 25 '18 at 9:25











  • When I use the command that I wrote upper in ubuntu terminal, It's gives me output. so how can I receive same output in .php file? how can I use -g in .php file and get the output?

    – FreeJoyMan
    Nov 25 '18 at 15:00













  • You can use the exec function to run the terminal command from your php code. php.net/manual/en/function.exec.php

    – Valerian Pereira
    Nov 25 '18 at 15:57













  • Links in the comments to stackoverflow.com/q/6805963/3995261 may be helpful (the short answer seems to be – it's not possible via include). The script you linked uses getopt so one question essentially is – how can you pass options to the script that uses getopt. May be the approach Valerian has suggested is the only option

    – YakovL
    Nov 25 '18 at 18:23













  • thank u guys, when I create a .php file and copy this code in it '<?php echo exec('whoami'); ' it's give me output in mozila. but when I use for example './hd-wallet-derive -g ' it dose not show any result? it require root acces? u give it root access? or any idea to excute this command in .php?

    – FreeJoyMan
    Nov 26 '18 at 9:33
















-1















I want to use commands from the hd-wallet-derive command tool in my website.



For example I run this in Ubuntu terminal and it works fine:



$ ./hd-wallet-derive.php -g --key=xprv9tyUQV64JT5qs3RSTJkXCWKMyUgoQp7F3hA1xzG6ZGu6u6Q9VMNjGr67Lctvy5P8oyaYAL9CAWrUE9i6GoNMKUga5biW6Hx4tws2six3b9c --path=m/1 --cols=all --includeroot --numderive=3


But how can I use this code in my PHP file and get output?



For example if I click on a button in my PHP page, the below command run?










share|improve this question

























  • please specify what works fine means. Does this include providing some output, or you need to just run those commands?

    – YakovL
    Nov 25 '18 at 9:25











  • When I use the command that I wrote upper in ubuntu terminal, It's gives me output. so how can I receive same output in .php file? how can I use -g in .php file and get the output?

    – FreeJoyMan
    Nov 25 '18 at 15:00













  • You can use the exec function to run the terminal command from your php code. php.net/manual/en/function.exec.php

    – Valerian Pereira
    Nov 25 '18 at 15:57













  • Links in the comments to stackoverflow.com/q/6805963/3995261 may be helpful (the short answer seems to be – it's not possible via include). The script you linked uses getopt so one question essentially is – how can you pass options to the script that uses getopt. May be the approach Valerian has suggested is the only option

    – YakovL
    Nov 25 '18 at 18:23













  • thank u guys, when I create a .php file and copy this code in it '<?php echo exec('whoami'); ' it's give me output in mozila. but when I use for example './hd-wallet-derive -g ' it dose not show any result? it require root acces? u give it root access? or any idea to excute this command in .php?

    – FreeJoyMan
    Nov 26 '18 at 9:33














-1












-1








-1








I want to use commands from the hd-wallet-derive command tool in my website.



For example I run this in Ubuntu terminal and it works fine:



$ ./hd-wallet-derive.php -g --key=xprv9tyUQV64JT5qs3RSTJkXCWKMyUgoQp7F3hA1xzG6ZGu6u6Q9VMNjGr67Lctvy5P8oyaYAL9CAWrUE9i6GoNMKUga5biW6Hx4tws2six3b9c --path=m/1 --cols=all --includeroot --numderive=3


But how can I use this code in my PHP file and get output?



For example if I click on a button in my PHP page, the below command run?










share|improve this question
















I want to use commands from the hd-wallet-derive command tool in my website.



For example I run this in Ubuntu terminal and it works fine:



$ ./hd-wallet-derive.php -g --key=xprv9tyUQV64JT5qs3RSTJkXCWKMyUgoQp7F3hA1xzG6ZGu6u6Q9VMNjGr67Lctvy5P8oyaYAL9CAWrUE9i6GoNMKUga5biW6Hx4tws2six3b9c --path=m/1 --cols=all --includeroot --numderive=3


But how can I use this code in my PHP file and get output?



For example if I click on a button in my PHP page, the below command run?







php ubuntu






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 25 '18 at 15:06







FreeJoyMan

















asked Nov 24 '18 at 20:54









FreeJoyManFreeJoyMan

11




11













  • please specify what works fine means. Does this include providing some output, or you need to just run those commands?

    – YakovL
    Nov 25 '18 at 9:25











  • When I use the command that I wrote upper in ubuntu terminal, It's gives me output. so how can I receive same output in .php file? how can I use -g in .php file and get the output?

    – FreeJoyMan
    Nov 25 '18 at 15:00













  • You can use the exec function to run the terminal command from your php code. php.net/manual/en/function.exec.php

    – Valerian Pereira
    Nov 25 '18 at 15:57













  • Links in the comments to stackoverflow.com/q/6805963/3995261 may be helpful (the short answer seems to be – it's not possible via include). The script you linked uses getopt so one question essentially is – how can you pass options to the script that uses getopt. May be the approach Valerian has suggested is the only option

    – YakovL
    Nov 25 '18 at 18:23













  • thank u guys, when I create a .php file and copy this code in it '<?php echo exec('whoami'); ' it's give me output in mozila. but when I use for example './hd-wallet-derive -g ' it dose not show any result? it require root acces? u give it root access? or any idea to excute this command in .php?

    – FreeJoyMan
    Nov 26 '18 at 9:33



















  • please specify what works fine means. Does this include providing some output, or you need to just run those commands?

    – YakovL
    Nov 25 '18 at 9:25











  • When I use the command that I wrote upper in ubuntu terminal, It's gives me output. so how can I receive same output in .php file? how can I use -g in .php file and get the output?

    – FreeJoyMan
    Nov 25 '18 at 15:00













  • You can use the exec function to run the terminal command from your php code. php.net/manual/en/function.exec.php

    – Valerian Pereira
    Nov 25 '18 at 15:57













  • Links in the comments to stackoverflow.com/q/6805963/3995261 may be helpful (the short answer seems to be – it's not possible via include). The script you linked uses getopt so one question essentially is – how can you pass options to the script that uses getopt. May be the approach Valerian has suggested is the only option

    – YakovL
    Nov 25 '18 at 18:23













  • thank u guys, when I create a .php file and copy this code in it '<?php echo exec('whoami'); ' it's give me output in mozila. but when I use for example './hd-wallet-derive -g ' it dose not show any result? it require root acces? u give it root access? or any idea to excute this command in .php?

    – FreeJoyMan
    Nov 26 '18 at 9:33

















please specify what works fine means. Does this include providing some output, or you need to just run those commands?

– YakovL
Nov 25 '18 at 9:25





please specify what works fine means. Does this include providing some output, or you need to just run those commands?

– YakovL
Nov 25 '18 at 9:25













When I use the command that I wrote upper in ubuntu terminal, It's gives me output. so how can I receive same output in .php file? how can I use -g in .php file and get the output?

– FreeJoyMan
Nov 25 '18 at 15:00







When I use the command that I wrote upper in ubuntu terminal, It's gives me output. so how can I receive same output in .php file? how can I use -g in .php file and get the output?

– FreeJoyMan
Nov 25 '18 at 15:00















You can use the exec function to run the terminal command from your php code. php.net/manual/en/function.exec.php

– Valerian Pereira
Nov 25 '18 at 15:57







You can use the exec function to run the terminal command from your php code. php.net/manual/en/function.exec.php

– Valerian Pereira
Nov 25 '18 at 15:57















Links in the comments to stackoverflow.com/q/6805963/3995261 may be helpful (the short answer seems to be – it's not possible via include). The script you linked uses getopt so one question essentially is – how can you pass options to the script that uses getopt. May be the approach Valerian has suggested is the only option

– YakovL
Nov 25 '18 at 18:23







Links in the comments to stackoverflow.com/q/6805963/3995261 may be helpful (the short answer seems to be – it's not possible via include). The script you linked uses getopt so one question essentially is – how can you pass options to the script that uses getopt. May be the approach Valerian has suggested is the only option

– YakovL
Nov 25 '18 at 18:23















thank u guys, when I create a .php file and copy this code in it '<?php echo exec('whoami'); ' it's give me output in mozila. but when I use for example './hd-wallet-derive -g ' it dose not show any result? it require root acces? u give it root access? or any idea to excute this command in .php?

– FreeJoyMan
Nov 26 '18 at 9:33





thank u guys, when I create a .php file and copy this code in it '<?php echo exec('whoami'); ' it's give me output in mozila. but when I use for example './hd-wallet-derive -g ' it dose not show any result? it require root acces? u give it root access? or any idea to excute this command in .php?

– FreeJoyMan
Nov 26 '18 at 9:33












1 Answer
1






active

oldest

votes


















0














hd-wallet-derive is sending usage info to stderr, not stdout. To capture that, you could run the command as eg: ./hd-wallet-derive -g 2>&1



More to your question though, there is an option --outfile= to write report output to a given file. In a web app, you should specify a unique filename for the user. Further, you can specify what type of report output you want using the --format flag.



Usage info is here:
https://github.com/dan-da/hd-wallet-derive#usage






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53462276%2fhow-to-use-hd-wallet-derive-in-php-file%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    hd-wallet-derive is sending usage info to stderr, not stdout. To capture that, you could run the command as eg: ./hd-wallet-derive -g 2>&1



    More to your question though, there is an option --outfile= to write report output to a given file. In a web app, you should specify a unique filename for the user. Further, you can specify what type of report output you want using the --format flag.



    Usage info is here:
    https://github.com/dan-da/hd-wallet-derive#usage






    share|improve this answer




























      0














      hd-wallet-derive is sending usage info to stderr, not stdout. To capture that, you could run the command as eg: ./hd-wallet-derive -g 2>&1



      More to your question though, there is an option --outfile= to write report output to a given file. In a web app, you should specify a unique filename for the user. Further, you can specify what type of report output you want using the --format flag.



      Usage info is here:
      https://github.com/dan-da/hd-wallet-derive#usage






      share|improve this answer


























        0












        0








        0







        hd-wallet-derive is sending usage info to stderr, not stdout. To capture that, you could run the command as eg: ./hd-wallet-derive -g 2>&1



        More to your question though, there is an option --outfile= to write report output to a given file. In a web app, you should specify a unique filename for the user. Further, you can specify what type of report output you want using the --format flag.



        Usage info is here:
        https://github.com/dan-da/hd-wallet-derive#usage






        share|improve this answer













        hd-wallet-derive is sending usage info to stderr, not stdout. To capture that, you could run the command as eg: ./hd-wallet-derive -g 2>&1



        More to your question though, there is an option --outfile= to write report output to a given file. In a web app, you should specify a unique filename for the user. Further, you can specify what type of report output you want using the --format flag.



        Usage info is here:
        https://github.com/dan-da/hd-wallet-derive#usage







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 3 '18 at 13:59









        dandadanda

        133




        133






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53462276%2fhow-to-use-hd-wallet-derive-in-php-file%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Contact image not getting when fetch all contact list from iPhone by CNContact

            count number of partitions of a set with n elements into k subsets

            A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks