How to configure Sonarqube for PHP projects?

user2995833 picture user2995833 · Feb 13, 2017 · Viewed 8.5k times · Source

Trying to setup Sonarqube for PHP code base for codecoverage analysis. I have modified the sonar-scanner.properties file with the following configuration.

Path = sonar-scanner-2.8\conf\sonar-scanner.properties
sonar.projectKey=PhpProject
sonar.projectName=PhpProject
sonar.language=php
sonar.sources=C:/Users/Hameetha/Downloads/SonarSource-sonar-examples-4.5-21-gbb6c0f9/SonarSource-sonar-examples-bb6c0f9/projects/languages/php/php-sonar-runner-unit-tests
sonar.scm.provide=sonarphp

however when running the sonar-scanner the following error msg is shown.

enter image description here

Answer

Having a closer look to the console, you'll see the following message : You must install a plugin that supports the language 'php'.

So all you need to do is to install the SonarPHP plugin: https://docs.sonarqube.org/display/PLUG/SonarPHP