Since Sonar PHP 1.2, all the external tools (PHP Depend, PHPMD, etc.) are shipped with the plugin and thus, no longer need to be installed separately.
Versions of the external tools embedded as PHAR in the plugin:
|Sonar PHP plugin||1.2|
Long Way (for production environment)
You have to be logged in as an administrator to run the commands below.
- Install PHP version 5.2.6 or newer. You can download PHP at this location and follow the instructions to install it.
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:
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):
Install PHPUnit from pear using the following command lines:
- Install XDebug to allow code instrumentation used for instance by phpunit to compute coverage.
If you are running Linux or Mac, you must install phpize and php headers (normally found in php dev packages) and then compile xdebug via pecl:
Another example on Fedora 18:
And then edit your $PHP_HOME/php.ini file to add the following line:
If you are running Windows, you should download the binary version matching your PHP installation from this location. And then edit your $PHP_HOME/php.ini file to add the following line:
Install PHP Depend: