Check out example codes for "run a server php terminal". It will help you in understanding the concepts better.

Code Example 1

$ cd ~/public_html
$ php -S localhost:8000

Learn ReactJs, React Native from akashmittal.com