Let’s Begin Your PHP Programming Using XAMPP

You have probably known that programmers can obtain a great amount of money for every project they are involved. Maybe you want to be someone who make a good living with programming. Well, its never too late to start something new. To start making your first program, You need to start with the simplest way.

XAMPP is one of the simplest way to build your first server-side program. It is a simple and complete package including PHP as web server, mysql as database, and FTP server for file transfer. In this tutorial, I am going to show you how to make a working PHP server using XAMPP. It is very simple, yet a lot of programmers are still using it today. Here are the steps to make it happen, because if you never start, you will never make it.

Here are steps to install and run XAMPP.

  1. Download XAMPP from the official website. Choose your Operating System according to the one that you are using.
  2. Run the installer and follow the install steps until finished.
    Install XAMPP
    Install XAMPP
    Install XAMPP
    Install XAMPP
    Install XAMPP

  3. Run XAMPP, click Start next to Apache Web Server and MySQL database.
    Start XAMPP Services

Now let’s roll your first PHP program.

  1. From finder or file explorer, go to your XAMPP installation directory, look for htdocs folder.
    xampp htdocs folder

  2. Create a new folder called first_project inside the htdocs folder, then create a new file called index.php.

    The name index.php is important for now, because by default, php will read the file as the first thing to read when it runs in the parent folder, in this case, it is the first_project folder.
    XAMPP index.php file christechno.com

  3. Open index.php using your favorite text editor. For example, you can use Notepad for Windows, or TextEdit for MacOs.
  4. Write down the script below in order to test and run your first PHP server. This will output “Hello World” if the server is running and configured properly.

    <?php
    echo "Hello World";
    ?>

  5. Save the changes, open your browser, then try to access localhost/first_project from the url bar.
    Hello World christechno.com

  6. Congratulations! You have successfully created a new web-based server side program using PHP.
    Although this only looks like a simple text showing on your browser, this is a very good start for web development, since you will be able to create much more dynamic things in PHP.

Keep in mind that this is just a start. Every web programmers have to understand this concept, that web server has to run in order to serve a client. I will show you more advanced things that cover managing inputs and performing mysql database in future post.

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *