In this tutorial, you shall learn how to create a PHP file in XAMPP folder, and run it on the server, to print a “Hello World” message in the browser window.

PHP Hello World

1. Start XAMPP and click on Open Application Folder.

There will be a directory named htdocs.

2. Open the directory, and create a file with .php extension, say helloworld.php.

3. Open helloworld.php with a text editor and write the following code in it.

4. Go to XAMPP application, and under Manage Servers, make sure the servers are running.

5. If all the servers are stopped, then click on the Start All button present on the bottom of the application.

6. Open a browser and hit the url http://localhost/helloworld.php

We have run our first PHP program in the server, and print Hello World.

Conclusion

In this PHP Tutorial, we learned how to write a PHP program, and run it using XAMPP, with the help of an example.