If you are familiar with the PHP environment, you may just need to read the 'Short Way' section.
If you need more help, you can follow the 'Long Way' installation guide.

Short Way for PHP Expert

  1. Install PHP runtime with the corresponding xdebug extensions. Version 5.2.6 or newer is required.
  2. Install PEAR. Version 1.8.0 or newer is required.
  3. Install the following PEAR packages (check the External Tools Versions section to know which versions to install):
    1. Install PHPUnit
    2. Install PHP Depend
    3. Install PHPMD
    4. Install PHP_CodeSniffer

Long Way for PHP Dummy

You have to be logged in as an administrator to run the commands below.

  1. Install PHP version 5.2.6 or newer. You can download PHP at this location and follow these installation instructions.
  2. Install PEAR version 1.8.0 or newer if not included in PHP distribution. To ensure PEAR version and to upgrade it, type the following commands in command prompt:

    pear version
    pear upgrade pear
    

    If you, for some reason, need the latest PEAR and the commands above don't get it then download http://pear.php.net/go-pear.phar and execute it with php (don't use the old go-pear without the .phar extension, it will likely fail):

    php go-pear.phar
    



  3. Install PHPUnit from pear using the following command lines:

    pear channel-discover pear.phpunit.de
    pear channel-discover pear.symfony-project.com
    pear install phpunit/PHPUnit-3.5.5
    



  4. Install XDebug to allow code instrumentation used for instance by phpunit to compute coverage.
  5. Install PHP Depend:

    pear channel-discover pear.pdepend.org
    pear install pdepend/PHP_Depend-1.0.3
    



  6. Install PHPMD:

    pear channel-discover pear.phpmd.org
    pear install --alldeps phpmd/PHP_PMD-1.3.2
    



  7. Install PHP_CodeSniffer:

    pear install PHP_CodeSniffer-1.3.2
    

External Tools Versions

The versions listed below are the ones we use for developments and tests.
That's why, we highly recommend you to use these versions as well (even if the Sonar PHP plugin might also be compatible with other versions).

Sonar PHP Plugin

PHP Runtime

PHPUnit

PHP Depend

PHPMD

PHP_CodeSniffer

1.05.2.6+3.5.50.10.71.2.01.3.2
1.15.2.6+3.5.51.0.31.3.21.3.2