No output from PHP interactive on Windows

前端 未结 8 2087
轻奢々
轻奢々 2020-12-16 13:28

I\'m running php interactively from xampp (5.4.7) on my Win 7 machine and cannot get any output from the window. I searched around various solutions and nothing so far has

8条回答
  •  别那么骄傲
    2020-12-16 13:33

    As you can read from the other answers, Windows PHP does not support echoing commands(easily). On Windows 10 there is a way around this however, you can enable the Windows 10 Ubuntu sub-shell system.

    To install windows-subsystem for linux

    Do one of the following:

    • Control Panel -> Apps -> Administrate optional features. Then make sure Windows-subsystem for linux is checked.

    • You can also install it by running Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux in an elevated Powershell Window.

    Now reboot(maybe bookmark this page first)

    Once you've rebooted install this app and open it. When it's done loading and you've created your user, type sudo apt update && apt upgrade && apt install PHP.

    Now when you need php interactive just open command prompt and type bash then php -a

提交回复
热议问题