Search code examples
phpxamppcomposer-phpmatomo

Composer fails to install Piwik on Windows


Tools:

  • Windows 8.1 Pro
  • Composer
  • piwik
  • xampp v3.2.1

I've installed piwik and composer and I'm testing them out in xampp. I'm going through this guide found at: http://developer.piwik.org/guides/getting-started-part-1

However, I've come across an issue. When I'm trying to run the command to install the 3rd party libraries, I'm getting this error:

c:\xampp\htdocs\Projects\piwik>php C:\ProgramData\ComposerSetup\bin\composer.phar install

'misc' is not recognized as an internal or external command, operable program or batch file. Script misc/composer/clean-xhprof.sh handling the pre-install-cmd event returned with an error

[RuntimeException] Error Output: 'misc' is not recognized as an internal or external command, operable program or batch file.

Does anyone know why this is happening?


Solution

  • Piwik's composer configuration will run shell scripts to install xhprof if possible. But it seems it is incompatible with Windows.

    I had created a new issue on the tracker: https://github.com/piwik/piwik/issues/6493

    Edit: I have reproduced it. In the meantime you can use:

    php C:\ProgramData\ComposerSetup\bin\composer.phar install --no-scripts
    

    I have tried it and it works on Windows. Remember you also need to have git installed, else some dependencies cannot be fetched.

    Edit 2: I have fixed the bug in master, it will be included in the next release, probably 2.9.0.