13

I run this from php file

exec("epm package");

i got below error in error_log

sh: epm: command not found

I tested manually in terminal it works fine.

3 Answers 3

15

Try putting in a full path name:

exec("/path/to/epm package");

Your webserver process won't necessarily be set up with the same configuration as your own account.

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

Comments

3

sounds like epm isn't in the PATH environment variable for the user your webserver is running (probably apache). to solve this, do one of these:

  • add the path to epm to the webserver-users PATH
  • provide the full path for your command to be executed (/whatever/folder/epm package)

Comments

2

I'm assuming the user you are testing with in the terminal and the webserver user running your PHP are different. You need to make sure directory for the epm package is exported to the PATH environment variable for the webserver user.

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.