0

I have added this line PATH DEFAULT=${PATH}:~/bin/ to the ~/.pam_environment This allows me to call ffmpeg from command line without path which is obviously in ~/bin/ dir so everything works fine as long as im ussing command line.

But if try to run the exact same command from php all i get is sh: ffmpeg: not found And the code is

shell_exec("ffmpeg 2>&1");

So from my very little experiance with linux (in this case Ubuntu to be specific) i guess apache has no access to pam_environment or ~/bin

What can i do to make this work?

2
  • use shell_exec("/bin/ffmpeg 2>&1"); ? Commented Feb 13, 2014 at 12:01
  • iirc the ~ is your home dir. So that would be a different directory for apache, wouldn't it? Try setting the full path. Commented Feb 13, 2014 at 12:12

1 Answer 1

1

look at the output of phpinfo(), it has a section with all environment variables it sees. then look at your webserver configuration, maybe it's sanitizing the environment, or maybe the init script which starts your webserver does it.

and is the account the webserver is running under using PAM at all?

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

2 Comments

Okay so environment doesnt have path that i set in ~/.pam_environment where can i find whats removing it?
Well i got it, now it says permission denied thou, but thats no longer related to this question, thanks for helping.

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.