Question

Possible Duplicate:
Problem executing bash file

I have created a bash file script and stored in some directory. Now I need to create a php script to execute this bash script so anyone can help me!!

Was it helpful?

Solution

You could use exec.

exec('/path/to/that/bash/file');

OTHER TIPS

Function exec gets executes script and with additional parameter it collects output from script.

$output = '';
exec("/path/to/your/bash/script.sh", &$output);
echo $output;

shell_exec or exec can help you. Read more at http://us.php.net/exec

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top