Composer, PhpStorm and Xampp

Currently I’m doing some PHP stuff again and I wondered how to use Composer together with PhpStorm and Xampp.

I assume that PhpStrom and Xampp are downloaded, installed and PHP interpreter in PhpStorm is configured properly.

Next step is to download composer.phar and save anywhere you can remember on your computer.

Now open the project in which you’d like to work with Composer.

On the main menu, choose Tools | Composer | Init Composer.

In the Composer Settings dialog that opens, specify the location of the composer.phar file to use.

If there has been none PhpStorm will create a composer.json stub where xou can add dependencies Tools | Composer | Add Dependency

If there is already a json file and you want to update your dependencies you have to add composer as a command line tool.

This can be done via File | Settings | Project Settings | Command Line Tool support.

Hit the plus on the right side, choose Composer from dropdown and specify path to composer.phar on your computer. I prefer to use composer and not c as recommended as Alias.

If you now go to Tools |  Run Command and start typing composer auto complete is available.

Before it works you should enable openssl PHP module in php.ini by uncommenting extension=php_openssl.dll.

Then you should be able to do a composer update.

Hope that helps somebody.

GD Star Rating

Kommentar verfassen