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.
There could be three possible reasons why it cannot find the command: It's a typo and the command name is misspelled. The command is not even installed. The command is basically an executable script and its location is not known.
The best feature of the find command is its exec argument that allows the Linux user to carry out any command on the files that are found. In other words, actions can be performed on the files that are found.
Linux exec Command Syntax If an argument is present, the exec command replaces the current shell with the executed program. In a Bash script, any commands after do not get executed. If no command argument is present, all redirections occur in the current shell.
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.
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
)If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With