Is there any way to test PHP locally without installing a server?

前端 未结 9 1952
刺人心
刺人心 2020-12-23 11:28

I\'m looking for something like http://phpfiddle.org/, but completely local. I don\'t want to commit to installing something as complex as Apache, then PHP on top of that, j

相关标签:
9条回答
  • 2020-12-23 12:06

    For Windows Users:

    Check out the ezPHP GitHub project. Per the project description...

    EzPHP is an alternative to Xamp/Wamp. EzPHP is the easiest way to setup a PHP development environment for learning PHP programming on Windows.

    The scope of this project is to provide a single .exe file that will get you a PHP developing server.

    Link - https://github.com/marcomilon/ezphp

    Setting it up was simple. Download the exphp.exe file and drop it in a folder. When you run the exe, it will launch the server and generate a public_html folder and index.php file. Follow the instructions in the command window and navigate to http://localhost:8080. Now you can start developing in the public_html folder and refresh your browser to see your changes.

    0 讨论(0)
  • 2020-12-23 12:10

    You can install either XAMPP or WAMP server locally if you find it complicated to configure PHP for Apache.

    0 讨论(0)
  • 2020-12-23 12:11

    As a minimalistic solution, on the command line you can also start php in interactive shell with php -a that will execute the commands you enter line by line. I often use it for testing small snippets of code.

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