'spark' is not recognized as an internal or external command, operable program or batch file. It's a new laptop, I installed xampp, composer, laravel, node.js &npm. Then download the spark installer from github and did 'composer install' from the 'spark-installer' directory.
PHP not recognized as an internal or external command is a common error Windows users running XAMPP will see. No worries though, there’s an easy fix. The ProblemI was working with Laravel, to test it out, and needed to use ‘php artisan’ to access Laravel’s command-line tool. I cd’ed to my project folder and typed: php artisan key:generateThe above is used to generate a 32 character application key.
Kind of nice so you don’t have to create it yourself. Anyway, my command line did it’s best and returned ‘php not recognized as an internal or external command’. The tutorial I was following didn’t say anything about that! Oh wait, they’re on a Mac, I’m on a Windows machine. Time to dive into the error problem.After some googling, I found that I needed to adjust the PATH names so my computer would recognize PHP and MySQL.
I’m running XAMPP, so I needed to point my computer to the XAMPP location. Let’s head through how to add the php path so your computer loves you enough to run php as a command.
The SolutionFrom the start menu, right-click ‘Computer’ and click ‘Properties’. You’ll see the image on the right pop up. Toward the bottom, click on ‘Environment Variables’.I see the look on your face, you’re getting nervous but it’s all good. Almost finished. From this page take a look at the items in ‘System Variables’.
Scroll down until you see a variable named ‘Path’ (not PATHTEXT). Click on ‘Path’ and click Edit. Go to the very end and add your path name to PHP and MySQL. For me, I have XAMPP running on a separate hard drive than C: so I had to add the following:;E:xamppphp;E:xamppmysqlbin;Notice that I had to add a semicolon at the beginning to separate it from all of the other paths.
Now, for the most important part. Make sure everything is saved, close it out and then restart your computer. The ResultNow that your computer has rebooted, try out your command again. To double-check, and in case you don’t need to use the command line for anything at the moment, go ahead and type the following: php -vYou should get a response along the lines of: PHP 5.4.7 (cli) (built: Sep 12 2012 23:48:31)Copyright (c) 1997-2012 The PHP GroupZend Engine v2.4.0, Copyright (c) 1998-2012 Zend TechnologiesIf your response is not some version of PHP, you may want to double check your steps.
If you followed them correctly and are still stuck, comment below!I hope to eventually discuss my Laravel adventures, but besides that, what else would you look to see?Tags:,.
Closed as off-topic by, May 25 '18 at 15:20This question appears to be off-topic. The users who voted to close gave this specific reason:. ' Too localized - this could be because your code has a typo, basic error, or is not relevant to most of our audience.
Consider revising your question so that it appeals to a broader audience. As it stands, the question is unlikely to help other users (regarding typo questions, see for background).' – hot2use, Tom V, Colin 't Hart, Philᵀᴹ, Max VernonIf this question can be reworded to fit the rules in the, please. You might want to try the following instead: C:xamppmysqlbinmysql.exe -u root -passuming you are using a CMD / DOS PromptDepending on the path in which your mysql.exe resides, you might have to incorporate using double quotes as follows: 'C:Program Files (x86)mysqlbinmysql.exe' -u root -p'assuming you are using a CMD / DOS PromptYou add double-quotes from 'C. To the end of the executable.exe' and then add double-quotes at the beginning of the whole command until the end. You end up with the above command.Reference: (Microsoft Support).