0

İ 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);
}
3
  • Please post your code as well as the error you are receiving. Commented Oct 10, 2013 at 6:37
  • system(), exec(), etc... Commented Oct 10, 2013 at 6:38
  • i added code, but i didn't get error. just not working and get null. charles, sorry but i can't understood what did you mean. Commented Oct 10, 2013 at 6:48

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.