Setup web development environment using free and open source XAMPP server. Learn, create and test your PHP projects on localhost by following a few easy steps.

Create Your First PHP Project With XAMPP Open Source Web Server

XAMPP is an open source web server which provides a local environment to create, run and test a PHP project before deploying it on live servers. It provides a local server for developers to test and build web apps. We will cover following sections in this blog post:

Requirements

  • XAMPP Installation
  • Code editor application
  • Basic PHP knowledge
  • Basic HTML and JavaScript knowledge

What is XAMPP?

XAMPP is an open source web server solution stack. It contains Apache, MySQL, MariaDB, PHP, and Perl. It is extremely easy to install and use. That’s why it’s the most popular PHP development environment. XAMPP server provides a complete environment for PHP web app development. If you don’t already have XAMPP working installation, then follow this guide to install XAMPP:

Setup XAMPP and phpMyAdmin as localhost on Windows

Create PHP script

  • Assuming that you have already installed XAMPP by following above tutorial, now let’s create a simple PHP script and test it on XAMPP.
  • First open your editor. If you don’t have a programming editor, simply open up Notepad.
  • Enter following code
<?php
echo "This is my first PHP project";
?>
  • Click on “File” on top right corner.
  • Hit “Save as” button.
  • Enter the name with extension “.php”.
  • For “Save as type”, select “All Files (*.*)” option.
  • And finally hit “Save” button.
Create Your First PHP Project With XAMPP Open Source Web Server

Run and test PHP script

  • Copy this PHP script to htdocs folder inside your XAMPP installation. Mostly htdocs folder resides here: C:\xampp\htdocs
  • Open up your browser.
  • Go to localhost/my_first_php_project.php
Create Your First PHP Project With XAMPP Open Source Web Server

Congratulations! you have just created your first PHP project.

Conclusion

Creating first web project is always very exciting for a beginner. It feels great when you design your first dynamic script, run it and view it working on your browser. I hope this simple guide has helped you with creating and running your first PHP project with XAMPP open source web server.

Explore

To learn more about XAMPP and phpMyAdmin, checkout following guides:

Setup XAMPP and phpMyAdmin as localhost on Windows

Free Web Server Solution Stack for PHP & Perl Developers