Вопрос

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!!

Это было полезно?

Решение

You could use exec.

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

Другие советы

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

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top