Reputation: 6765
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.
Upvotes: 13
Views: 8975
Reputation: 51807
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:
epm
to the webserver-users PATH/whatever/folder/epm package
)Upvotes: 3
Reputation: 10732
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.
Upvotes: 15
Reputation: 1575
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.
Upvotes: 2