PHP - Use the Integrated Webserver for Quick Debugging

Ever since PHP 5.4, PHP has a built-in webserver to help with debugging. This can be useful if you just want to test a script quickly on your local computer without having to configure Apache or nginx.

To run the integrated webserver, simply navigate to the directory you want to act as your website's root and execute:

php -S localhost  

If you already have apache2 running, then you may want to use a different port as shown below:

php -S localhost:8080  



Stuart is a software developer with a passion for Linux and open source projects.

comments powered by Disqus