Last Updated: February 25, 2016
·
898
· jmarizgit

Built in web servers in Rails, Python, and PHP

When you just wanna preview your web project you can use the following quick web server commands:

Rails using webrick (you should know this unless you are new with rails) will run on http://0.0.0.0:3000:

$ rails s

In Python by default your server will run on http://0.0.0.0:8000 using simpleHTTP server:

$ python -m SimpleHTTPServer

In PHP you have to setup where you want your server running. Let's setup a web server running on http://0.0.0.0:8000 using built-in HTTP server (since version 5.4):

$ php -S 0.0.0.0:8000

Remember to check the documentation if you want to change the address/port for your web server. Use this to quickly test your web applications (not recommended to use in production).

Happy Hacking.