Bioinformatics ReviewBioinformatics Review
Notification Show More
Font ResizerAa
  •  Home
  • Docking
  • MD Simulation
  • Tools
  • More Topics
    • Softwares
    • Sequence Analysis
    • Algorithms
    • Bioinformatics Programming
    • Bioinformatics Research Updates
    • Drug Discovery
    • Phylogenetics
    • Structural Bioinformatics
    • Editorials
    • Tips & Tricks
    • Bioinformatics News
    • Featured
    • Genomics
    • Bioinformatics Infographics
  • Community
    • BiR-Research Group
    • Community Q&A
    • Ask a question
    • Join Telegram Channel
    • Join Facebook Group
    • Join Reddit Group
    • Subscription Options
    • Become a Patron
    • Write for us
  • About Us
    • About BiR
    • BiR Scope
    • The Team
    • Guidelines for Research Collaboration
    • Feedback
    • Contact Us
    • Recent @ BiR
  • Subscription
  • Account
    • Visit Dashboard
    • Login
Font ResizerAa
Bioinformatics ReviewBioinformatics Review
Search
Have an existing account? Sign In
Follow US
Bioinformatics Programming

How to execute Unix/shell commands in PHP?

Dr. Muniba Faiza
Last updated: March 6, 2021 6:19 pm
Dr. Muniba Faiza
Share
1 Min Read
programming in php
SHARE

Besides, Python & Perl, PHP is another language mostly used in bioinformatics programming. In this article, we provide a simple command to execute shell commands in a PHP script.

shell_exec()

It runs command via shell and returns the output as a string.

syntax: $output = shell_exec($command);

If you are using variables inside your command, you need to use escapeshellarg().

syntax: $output = shell_exec($command);

Let’s assume, if you are running the blastp command on a query file with a variable filename, then it could be run like this:

$output = shell_exec("blastp -query ".escapeshellarg($filename.'.fasta')." -db /path/to/db -out output.txt");


 

TAGGED:bioinformatics programmingPHPshell commands
Share This Article
Facebook Copy Link Print
ByDr. Muniba Faiza
Follow:
Dr. Muniba is a Bioinformatician based in New Delhi, India. She has completed her PhD in Bioinformatics from South China University of Technology, Guangzhou, China. She has cutting edge knowledge of bioinformatics tools, algorithms, and drug designing. When she is not reading she is found enjoying with the family. Know more about Muniba
Leave a Comment

Leave a Reply Cancel reply

You must be logged in to post a comment.

Starting in Bioinformatics? Do This First!
Starting in Bioinformatics? Do This First!
Tips & Tricks
[Editorial] Is it ethical to change the order of authors’ names in a manuscript?
Editorial Opinion
Installing bbtools on Ubuntu
[Tutorial] Installing BBTools on Ubuntu (Linux).
Sequence Analysis Software Tools
wes_data_analysis Whole Exome Sequencing (WES) Data visualization Toolkit
wes_data_analysis: Whole Exome Sequencing (WES) Data visualization Toolkit
Bioinformatics Programming GitHub Python

You Might Also Like

Extracting first and last residue from helix file in DSSP format.
Bioinformatics ProgrammingPythonSecondary structure

Extracting first and last residue from helix file in DSSP format.

May 12, 2022
Bioinformatics ProgrammingPython

dssp_parser: A new Python package to extract helices from DSSP files.

May 10, 2022
How to copy & rename files in same directory in Ubuntu (Linux)?
Bioinformatics Programming

How to copy and rename files simultaneously in same directory in Ubuntu (Linux)?

March 13, 2025
How to make swarm boxplot?
Bioinformatics ProgrammingGitHubPython

How to make swarm boxplot?

February 23, 2023
Copyright 2024 IQL Technologies
  • Journal
  • Customer Support
  • Contact Us
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Cookie Policy
  • Sitemap
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?

Not a member? Sign Up