Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Execute shell script with PHP

Status
Not open for further replies.

Edward999

Programmer
Dec 26, 2002
112
MY


Hi I'm using php, runign on Linux Machine. I need to know how to execute shell script on PHP.

Please help......

THanks in advance....

edward
 
use system() or exec()

___________________________________
[morse]--... ...--[/morse], Eric.
 
If you do execute shell commands - have a look at the escapeshellcmd() and escapeshellargs() for security reasons.
You can also use the backtick operator which you might be familiar with (as a Linux person).

PHP has quite a lot of shell like commands that can be safely triggered from within the PHP application. I only use shell commands if there is absolutely no alternative - and then with great care about a) security what is passed in and b) failure control if the shell command fails.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top