#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    2
    Rep Power
    0

    Executing system command from a CGI script


    Dear All,

    I am trying to run a standalone blast through a Perl CGI script. Please can someone let me know how I could use the system command to execute the blast program.

    for instance

    system("blastn -query in.fa -db nr -out out.fasta");

    The above code works perfectly when I run the perl script locally, but I face an error when I run it from a web server, which says

    "blastn -unrecognized external or internal command"


    Your inputs are highly appreciated.

    -vijay
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Apr 2009
    Posts
    1,875
    Rep Power
    1225
    Specify the full path to blastn in the system call.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    2
    Rep Power
    0
    Originally Posted by FishMonger
    Specify the full path to blastn in the system call.
    I tried the below code. but this time it says "premature end of script headers".

    $blast = "C:\\Apache24\\htdocs\\blast\\blastn -version";

    exec($blast);

    I tried putting in the exe file into the apache folder itself, but still no luck. Please can you advise me further.

    -vijay
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Apr 2009
    Posts
    1,875
    Rep Power
    1225
    This info should help: How to get over 'premature end of script headers' in Apache?

    Also, don't execute your blast command via exec().

IMN logo majestic logo threadwatch logo seochat tools logo