exec() doesnot work??

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dinesh1440
    New Member
    • May 2010
    • 16

    exec() doesnot work??

    When I run a command "blastp -query query.fasta -subject arbi.fasta " it gives the output in command promt. But it did not when used in exec as follows:

    $out=exec('blas tp -query query.fasta -subject arbi.fasta')
    echo $out;


    please help me in this..
  • dgreenhouse
    Recognized Expert Contributor
    • May 2008
    • 250

    #2
    Try:

    Code:
    // $out will contain the last line of the command
    $out=exec('blastp -query query.fasta -subject arbi.fasta', $output, $return_var);
    
    echo '<pre> The last line of output:<br>';
    echo $out.'<br>';
    echo 'The output:<br>';
    print_r($output);
    echo '<br>The status: '.$return_var;
    echo '</pre>';
    If this doesn't work try passthru()

    Also, the user the webserver is running as may not have execute permissions for the executable... Just a thought...

    Comment

    • abhishekmiet
      New Member
      • Mar 2011
      • 8

      #3
      You may check your php.ini file , if their exec is permitted or not....

      Comment

      Working...