Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Dec 2010
    Posts
    16
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Run bash script in php

    Hi,

    This is bash script -t "SOME PLAIN TEXT" -s plain -e normal -f Arial -p 48 -c royalblue -b white -u lightpink. How to run in php. help me pls.

    I tried this way

    $response = shell_exec('-t "SOME PLAIN TEXT" -s plain -e normal -f Arial -p 48 -c royalblue -b white -u lightpink'); //executing shell command.

    echo "<pre>$response</pre>";

    output is empty.

  • #2
    Senior Coder
    Join Date
    Sep 2010
    Posts
    1,912
    Thanks
    15
    Thanked 227 Times in 227 Posts
    $response = `echo -E "-t \"SOME PLAIN TEXT\" -s plain -e normal -f Arial -p 48 -c royalblue -b white -u lightpink"`; //executing shell command.

  • #3
    Regular Coder patryk's Avatar
    Join Date
    Oct 2012
    Location
    /dev/couch
    Posts
    398
    Thanks
    2
    Thanked 64 Times in 64 Posts
    actually 99% of servers would use sh as default shell and not bash.
    that's for performance.

    if you want to run a bash script u should create script file, chmod it so server could execute it and then call it with shell_exec()


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •