bzsveq
Last Updated: February 25, 2016
·
1.349K
· ipetepete
522f44265e0ed80578f6d3af4cdf7011

Launch a quick PHP web-server for dev/tests

If you run PHP >= 5.4 you can do this (on the command line):

$> php -S localhost:9292

And it will start a web server in your current directory. This makes it easy to test backend json, responses, proxies etc etc. Of course, choose your own port

0 configuration + 0 Apache/Nginx = AWESOME

And as a bonus, if you do test some AJAX from another location, say a flat HTML file you might want to add this to your script:

header('Access-Control-Allow-Origin: *');
Say Thanks
Respond

1 Response
Add your response

4130

nice!

over 1 year ago ·