Remote call sonar-scanner prompt error “sonar-scanner: command not found”


(tester) #1

I want to use sonar-scanner in php program,but they are not in same server,when execute php program,I find that sonar-scanner command does not work.

I also use ssh xxx@xxx ‘sonar-scanner’ to remote call sonar-scanner,but it tells me that command not found.

but I run ‘sonar-scanner’ locally, it worked.

I want to know how can I remote call sonar-scanner?


(Adam Gabryś) #2

Did you try to execyte ssh xxx@xxx /full/path/to/sonar-scanner? I think the problem can be caused by path configuration of your ssh xxx user.


(tester) #3

I have used full path but it tells me that /full/path/sonar-scanner is a directory

after that,I install sonar-scanner and php program on the same server,in php api,I used ‘system(“sonar-scanner -v”)’,it also dose not work.

whether sonar-scanner cannot be used in http api


(Adam Gabryś) #4

I’m not sure, but maybe you point to sonar-scanner directory, not the script :wink: Example /opt/sonar-scanner-3.2.0.1227-linux/bin/sonar-scanner.

Try to login as php user and execute sonar-scanner -v. Maybe the scanner is not included in the path variable for this user.


(tester) #5

thank you very much!
It has resolved my question by using /opt/sonar-scanner-3.2.0.1227-linux/bin/sonar-scanner, it dose work.


(Adam Gabryś) #6

Great. Please mark my previous post as solution.
Cheers