'PHP' is Not Recognised in Command Line - Why ?

Hi - I want to use the command line with Laravel 4 artisan. Artisan works fine in the windows cmd. I have added php to the Development Envirtonment adn it comes up ion the external libraries.

But when I wish to execute the 'php artisan list' command inside the terminal I am getting an error: 'php' is not recognized as an internal or external command,

So what am I doing wrong ?

Many Thanks !


Hi there,

So far it sounds like shell/terminal/console is unable to find your php file in one o fthe PATH folders.

What OS do you have there? If Windows -- see what "PATH" command (actually, environment variable, to be precise) will show you. Is php.exe located in one of the folders listed there? If not -- try restarting.


Have you configure php.exe file path in environmental variables? This is the reason most of time "PHP is not recognized in command line" error occur. PLease look at this tutorial http://www.codeandtuts.com/php-is-not-recognized-as-an-internal-or-external-command/ 



How do i configure path only on phpstorm? If i use on system path the wamp says this is a error.


You can try setting them at File | Settings | Tools | Terminal > Environment Variables


I have try this, but wont work...


@Lindolfo A Junior

I do not know why you trying to use "php" as environment variable.

Better use PATH add add path to the folder with desired PHP installation as first entry.

For example (my specific path is used):


My default PHP is v7.3 (when running php -v in terminal). With the above option the default PHP will become v7.1.


Please sign in to leave a comment.