PHP Command Line Interface (CLI) Running built-in web server


As from version 5.4, PHP comes with built-in server. It can be used to run application without need to install other http server like nginx or apache. Built-in server is designed only in controller environment for development and testing purposes.

It can be run with command php -S :

To test it create index.php file containing

echo "Hello World from built-in PHP server";

and run command php -S localhost:8080

Now yout should be able to see content in browser. To check this, navigate to http://localhost:8080

Every access should result in log entry written to terminal

[Mon Aug 15 18:20:19 2016] ::1:52455 [200]: /