phplaravelampps

How do I solve 'php' is not recognized as an internal or external command, operable program or batch file


I recently installed AMPPS 3.8 which has PHP 5.6 and 7.1 bundled in it.

I can't run the following Laravel command:

composer create-project –prefer-dist laravel/laravel LaravelWorks “5.5”

via command prompt, rather I'm getting the following error message:

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

I didn't have this problem when I was using an earlier version (AMPPS 3.2). Every solution I found on the web says I'm to check the PATH. I've checked and it seems okay... I think: C:\Ampps\php-5.6;C:\Ampps\php-7.1;C:\Ampps\php;

I keep getting this error message even when I switch to PHP 5.6.

My OS is Windows 7 on 32bit architecture.


Solution

  • Thanks everyone. I finally figured out the problem. Composer's path to PHP had changed after I installed the new version of AMPPS. So composer presumed no PHP installation exists because it had no correct path to execute PHP. I didn't know composer's path to PHP would need updating on a new AMPPs installation.

    So to everyone using an all-in-one local server package like AMPPS, ensure your "package manager" (in my case, Composer) has its PATH to executing PHP scripts updated correctly.