Last Updated: January 28, 2019
·
1.61K
· ipetepete

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: *');

1 Response
Add your response

nice!

over 1 year ago ·