Cannot run PHP CLI on WAMP on Windows 8

后端 未结 3 1199
难免孤独
难免孤独 2021-01-29 05:05

I have been trying on this for hours i Get the below error

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

3条回答
  •  孤城傲影
    2021-01-29 05:40

    Actually the php exe you run in wamp for the CLI is just php.exe

    It is found in the c\wamp\bin\php\phpX.Y.Z\ folder and called php.exe

    Suggest you create a little batch file to setup the path so you can use it from anywhere by just keying php, like this:

    phppath.cmd

    set path=%PATH%;c:\wamp\bin\php\phpX.Y.Z
    php -v
    

    Store this batch file in a folder on your path and you are golden.

提交回复
热议问题