shell_exec() function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Akkad
    New Member
    • Jun 2007
    • 18

    shell_exec() function

    hi, i am having problem using shell_exec() function:
    <code>
    echo shell_exec("cat `find ./logs -name access.log*` | grep akadi_icho | ./calamaris/calamaris -a -P 60 -T 0 -r 400 -d 500 -u -O -w");
    </code>
    i am not getting the ouput file, though the command string passed in the function is working perfectly when used on the shell.

    but when i am trying to execute it using this function in a php file, no ouput file is made.
    so plz if anyone have an idea about this plz help me.

    regards
    Last edited by Akkad; Jul 30 '07, 09:32 AM. Reason: error in code
  • vituko
    New Member
    • Dec 2006
    • 48

    #2
    Does your hosting allow you to access the shell? Usually does not.
    I see nothing strange in this statement...

    Comment

    • Akkad
      New Member
      • Jun 2007
      • 18

      #3
      Actually i have full access to the shell but running this code in a php file on xampp server that i have on the linux, i am not getting the output even when i am trying to pipe the output to an html file .
      <code>

      shell_exec("cat `find ./logs -name access.log*` | grep akadi_icho | ./calamaris/calamaris -a -P 60 -T 0 -r 400 -d 500 -u -O -F html>akadi_icho .html");

      </code>
      but when i am running this code on the shell directly :
      <code>
      cat `find ./logs -name access.log*` | grep akadi_icho| ./calamaris/calamaris -a -P 60 -T 0 -r 400 -d 500 -u -O -F html>akadi_icho .html
      </code>
      it is working perfectly.
      so i have tried to run the code in parts :
      <code>
      shell_exec("cat `find ./logs -name access.log*` | grep akadi_icho");
      </code>
      this part is working, but when i am running the whole part i am not getting any output.

      so plz can u help me to figure out the problem.

      Comment

      Working...