How To Run PHP From Windows Command Line in WAMPServer

前端 未结 11 834
予麋鹿
予麋鹿 2020-11-22 04:58

I\'m new to php and wanted to run php from command line. I have installed WAMP and set the \"System Variables\" to my php folder ( which is C:\\wamp\\bin\\php\\php5.4.

11条回答
  •  一整个雨季
    2020-11-22 05:18

    I remember one time when I stumbled upon this issue a few years ago, it's because windows don't have readline, therefore no interactive shell, to use php interactive mode without readline support, you can do this instead:

    C:\>php -a 
    Interactive mode enabled 
    
     
    ^Z 
    Hello, world!
    

    After entering interactive mode, type using opening () and closing (?>) php tag, and end with control Z (^Z) which denotes the end of file.

    I also recall that I found the solution from php's site user comment: http://www.php.net/manual/en/features.commandline.interactive.php#105729

提交回复
热议问题