‘php.exe’ is not recognized as an internal or external command, operable program or batch file

前端 未结 10 1239
后悔当初
后悔当初 2020-11-29 08:24

‘php.exe’ is not recognized as an internal or external command, operable program or batch file.

Why does that error occur even though

相关标签:
10条回答
  • 2020-11-29 08:27

    I think you need to change it to A:\xampp\php\ and just leave it there, then it will search the directory for the file, also: have you tried calling just php instead of php.exe and check that the directory is correct.

    0 讨论(0)
  • 2020-11-29 08:29

    enter image description here

    View above screen shot for setup enviroment variable in window 7

    Note:- After setup enviroment variable please restart you computer then its will work fine

    0 讨论(0)
  • 2020-11-29 08:30

    Set PHP as environment variable from System as below to run it from CMD

    1)Windows key + Pause
    2)Click on Advanced system settings
    3)Now click on Environment Variables.. button  
    4)In system variable section search for Path and edit it as D:\wamp\bin\php\php5.3.13;(If one needs to append it to some already exits value then start path with;)
    5)Now open CMD and run command PHP from any path where you don’t have PHP installed , in my case it’s C drive.
    6)We can check above set Path from CMD using Path command also.
    
    0 讨论(0)
  • 2020-11-29 08:32

    Shouldn't the last part be: C:\xampp\php\ ? Unless you remapped your drives, A is the floppy disk. :)

    Also, you need to specify the folder, not the exe file itself.

    0 讨论(0)
  • 2020-11-29 08:34

    My case am Using Bitnami Ruby Stack apache Web server ,

    1. Pressed Windows key + Pause/Break Button
    2. Clicked advanced system settings
    3. Click Environment Variables
    4. Under System variables > edit PATH variable by adding C:\Bitnami\rubystack-1.9.3-24\php
    5. Click Ok to close the Environment Variable window
    6. Close your command prompt if open

      *(Proceed to 7. to confirm if php is installed)

    7. Press Windows Key + R button to open your cmd
    8. Type php -v to view your php version Confirm installed php version
    0 讨论(0)
  • 2020-11-29 08:36

    In my case, environment path is C:\ProgramData\Drush\;C:\Program Files (x86)\Drush\Php; and it works for me.

    If I simply add C:\xampp\php\ dint work for me.

    I hope if someone facing this issue can try this suggestion.

    0 讨论(0)
提交回复
热议问题