Home > Article > Backend Development > How to use php after installing xampp
XAMPP is a very popular web server software package. It contains various tools such as Apache, MySQL and PHP so that you can run PHP applications on your local computer. In this article, we will introduce you how to install XAMPP and write your own website program in PHP.
Step One: Download XAMPP
Before you start, you need to download XAMPP from the XAMPP official website. After downloading, you can run the installer and follow the prompts in the wizard to install the program.
Step 2: Start the Apache server
After starting XAMPP, you need to start the Apache server. On Windows, you can click the Apache button on the XAMPP control panel to start the server. On a Mac, you can start the Apache server from Terminal.
Step 3: Test the server
After starting the Apache server, you can open a web browser and enter "http://localhost" to test whether the server is running normally. If everything is fine, you should see the XAMPP welcome page.
If you see this page, congratulations, you have successfully started the XAMPP server.
Step 4: Write a PHP program
Now, we will write our first PHP program. You can open a text editor (such as Notepad or Sublime Text) and write the following code:
<?php echo "Hello World!"; ?>
Next, you need to save this file as "hello.php" and upload it to the XAMPP web server .
Step 5: Test the PHP program
To test the PHP program, you need to enter "http://localhost/hello.php" in your web browser. If everything goes well, you should see the string "Hello World!" appear in the browser page.
Now, you have successfully written your own website program using PHP. You can use XAMPP to run and test these programs and upload them to your web server.
Conclusion
If you want to use PHP for web development, then XAMPP is an excellent choice. By following the steps provided in this article, you can easily install XAMPP and start writing your own PHP programs.
The above is the detailed content of How to use php after installing xampp. For more information, please follow other related articles on the PHP Chinese website!