Before you can start building dynamic web applications with PHP, you need to set up a development environment on your computer. Unlike HTML or JavaScript, which run directly in the browser, PHP requires a web server and a PHP engine to process the code.
To run PHP code locally on your PC, you need three components:
Instead of installing these one by one, the easiest and most popular way for beginners to get started is by using a local server environment package.
These free software packages install everything you need with a single click:
htdocs folder inside your XAMPP installation directory (usually C:\xampp\htdocs on Windows).index.php.http://localhost/ to see your PHP code run!In this tutorial, you don't even need to install anything! You can use our "Try it Yourself" editor to execute PHP code instantly in your browser.