advertisement
Login | Register   
  Include Code  Search Tips
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   TIP BANK
Browse DevX
Download the sample code for this article.
Bash Availability
Partners & Affiliates
advertisement
advertisement
advertisement
advertisement
 

Integrating Bash with PHP

Bash scripts can simplify many OS-oriented tasks for PHP developers. Even better, you can run Bash scripts directly from PHP, passing arguments, arrays, and receiving output that you can analyze or display. 


advertisement
his article discusses how to install and configure three Bash distributions for Windows: the GNU BASH shell for Windows, the Win-Bash Windows port, and the Cygwin tool. It also demonstrates how to execute Bash scripts using PHP, how to send different types of arguments to a Bash script, how to use Bash functions from PHP, and how to save results to a text file. (For information about other Bash distributions, see the sidebar Bash Availability.)


Download and Configure GNU Bash Shell for Windows

First, download the GNU Bash shell for Windows. The tool is ready to use immediately after you extract the ZIP archive in your favorite location (for example, C:\bash-2.03\). To simplify calling Bash, you can add the bash.exe path to your CLASSPATH setting.

It's quick, easy and you get access to all the articles on DevX.
This registration/login is to allow you to read articles on devx.com.
Already a member?



advertisement