İ know this question is widely asked but I still can't do this. I have a working bash script. I used the shell_exec() method. I tried all cases: bash script and php file were in the same directory. Bash script were in home directory. I am using PHP 5.4 so, it can't from "safe_mode" error.

Any idea?

/**
 * @Route("/ftp")
 * @Template()
 */
public function ftpAction(){

    $output = shell_exec('sh ./test.sh');

    var_dump($output);

    return new Response('ftp :'.$output);
}
有帮助吗?
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top