I have setup my localhost on macOS big sur with apache and php (works fine). I now have a bash script that uses ant to build some source code, but I cannot run the ant command from within a bash script from the browser. I always receive ant: command not found
. I can run the bash script from the terminal with my user and the webuser (_www) ant this works as intenden. But I cannot get it to work when I call the site from my browser. Any ideas?
Asked
Active
Viewed 83 times
0

rkh
- 1
-
*"from within a bash script from the browser"*. How? You did an exec from PHP? Your Apache runs with a specific user, so when you call bash, it will create an instance of bash with the environment of that user, not yours. So my guess, ant is in a directory that is not listed in the PATH variable of your apache user. FYI please take the [tour] and read [ask] and [mcve]. – Nic3500 May 17 '21 at 15:17
-
Thanks, you were right the PATH variable was not set correctly. – rkh May 22 '21 at 07:06