Reputation: 1179
İ 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);
}
Upvotes: 0
Views: 284
Reputation: 1179
I found the solution. (https://serverfault.com/questions/272551/how-do-you-give-execute-permissions-to-apache2-user-and-not-to-everyone-else)
Sorry for that. Thanks for your help.
Upvotes: 1