PHP Server Usage - Zacham17/my-tech-journal GitHub Wiki

A PHP server can be started on a system with certain usage of the php command in linux.

Using the php -S command can be used to create an adhoc-web server that can interpret PHP code. This web server can be made accessible locally only or remotely.

Basic Command Usage:

php -S addr:port

For example, using the command php -S 127.0.0.1:9000 opens connections to the local address on port 9000. If a file called, index.php is made in the directory that server was created from, then browsing to 127.0.0.1:9000/index.php in a browser will open the webpage for the index.php file. An example of a PHP server being used to practice file inclusion can be found here.