title: PHP Dev Server tags: php net Source: [php.net](https://www.php.net/manual/en/features.commandline.webserver.php) ```bash $ cd ~/public_html $ php -S localhost:8000 $ php -S localhost:8000 -c php.ini ``` One of the comments: ``` It’s not mentioned directly, and may not be obvious, but you can also use this to create a virtual host. This, of course, requires the help of your hosts file. Here are the steps: 1 /etc/hosts 127.0.0.1 www.example.com 2 cd [root folder] php -S www.example.com:8000 3 Browser: http://www.example.com:8000/index.php Combined with a simple SQLite database, you have a very handy testing environment. ```