WAMP + Composer + Laravel + PhpStorm

I'm trying to make PhpStorm Command Line Tools Console work with Composer and Laravel on my computer running under Windows.

So here is what I did :

  • Installed WAMP
  • Configured PHPStorm php interpreter path
  • Installed Composer using
    (So my PATH vars are set).
  • Enabled
    mod in CLI.

Eveything works fine in command line, both native and cygwin.

But when I try to make a

composer update
from PhpStorm Command Line Tools Console I get the following
(in french):
Error Output: 'php' n'est pas reconnu en tant que commande interne  
ou externe, un programme ex�cutable ou un fichier de commandes.

Wich translated in english gives us:

Error Output: 'php' not recognized as an internal or external command,
operable program or batch file.

But php work perfectly in command line:

C:\Users\Me>php -v
PHP 5.4.12 (cli) (built: Feb 25 2013 00:29:22)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
    with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans

Does anyone has a clue on how to make this work ?

PS: aked the same question on stackoverflow http://stackoverflow.com/questions/17733072/wamp-composer-laravel-phpstorm

1 comment
Comment actions Permalink

Hi there,

Have you restarted PC after installing WAMP?

Basically, the IDE is unable to find php in any of the folders that are listed in the PATH environment variable. Most likely it still has original/old value which does not include path where PHP is installed (already running process will still see old PATH value -- it is not getting updated automatically -- that's how Windows works).

The easiest (and possibly the safest) way to tell PhpStorm what php command is to:

  1. Settings | Command Line Tool Support
  2. Create new GLOBAL entry:
    • Tool path: full path to php.exe
    • Alias: php

What it does -- when you now type php in Command Line Tool window, it will replace it by full path to the php.exe (e.g. "php -v" --> "C:\WAMP\bin\php\php.exe -v")

Instead of php use $PhpExecutable$ -- this is internal macros that will refer to your PHP Interpreter as configured in PhpStorm (will automatically expend to full path to php.exe when executed).


Please sign in to leave a comment.