Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


The plugin enables analysis of PHP projects within with SonarQube.

It is compatible with the Issues Report plugin to run pre-commit local analysis.


  1. Install the PHP Environment
  2. Install the plugin through the Update Center or download it into the SONARQUBE_HOME/extensions/plugins directory
  3. Restart the SonarQube server


Run anAnalysis with the SonarQube Runner (Recommended



To run an analysis of your PHP project, use the SonarQube Runner.

Sample projects are available on GitHub that can be browsed or downloaded: /projects/languages/php.


Most of the time, using the exclusion properties will be enough to exclude files from being reported by SonarQube. However, there might be some cases where you really want to exclude files from being analyzed by an external tool (may it be PHP CodeSniffer,  PHPMD or PHP Depend) because:

  • a file is badly written and the tool is crashing when analyzing this fileit, thus preventing SonarQube from completing the analysis
  • a big large number of files must be excluded and there's no need for the external tools to spend time analyzing files that won't be reported in SonarQube


titleBe carefull!

When specifying exclusions directly for each tool, you should also consider to set setting the sonar.exclusions property accordingly. Otherwise, you may have files with incomplete analysis.