Archive for Uncategorized

Instructions: Installing XAMPP and Testing Its Features with a PHP Website

Objective:

The objective of this lab is to guide you through the process of installing XAMPP on your computer and testing its functionality by running a PHP website.

Prerequisites:

  • A computer running Windows, macOS, or Linux
  • Internet connection
  • Basic understanding of computer operations

Part 1: Installing XAMPP

Step 1: Downloading XAMPP

  1. Open a web browser and navigate to the XAMPP official website.
  2. Click on the “Download” button to download the latest version of XAMPP suitable for your operating system (Windows, macOS, Linux).

Step 2: Installing XAMPP

For Windows:

  1. Locate the downloaded XAMPP installer (e.g., xampp-windows-x64-7.4.24-1-VC15-installer.exe).
  2. Double-click on the installer to launch the installation wizard.
  3. Follow the on-screen instructions to install XAMPP. Make sure to select the components you want to install, such as Apache, MySQL, PHP, and phpMyAdmin.

For macOS:

  1. Locate the downloaded XAMPP DMG file (e.g., xampp-osx-7.4.24-1-installer.dmg).
  2. Double-click on the DMG file to mount it.
  3. Drag the XAMPP folder to the Applications folder.
  4. Open the XAMPP folder in the Applications folder and double-click on the “manager-osx” application to start XAMPP.

For Linux:

  1. Open a terminal window.
  2. Navigate to the directory where the XAMPP installer is downloaded.
  3. Give execute permission to the installer using the command: chmod +x xampp-installer.run.
  4. Run the installer with the command: sudo ./xampp-installer.run.
  5. Follow the on-screen instructions to complete the installation.

Step 3: Starting XAMPP

  1. Open the XAMPP control panel.
  2. Start the Apache and MySQL services by clicking on the “Start” buttons next to them.

Part 2: Testing XAMPP with a PHP Website

Step 4: Creating a PHP Website

  1. Navigate to the XAMPP installation directory (C:\xampp on Windows, /Applications/XAMPP on macOS, or /opt/lampp on Linux).
  2. Go to the htdocs folder.
  3. Create a new folder named phpwebsite.
  4. Inside the phpwebsite folder, create a new file named index.php.
  5. Open index.php with a text editor (e.g., Notepad, Visual Studio Code) and add the following PHP code:

6. Save the index.php file and close the text editor.

Step 5: Accessing the PHP Website

  1. Open a web browser.
  2. Enter the following URL in the address bar:
    • For Windows: http://localhost/phpwebsite/index.php
    • For macOS and Linux: http://localhost/phpwebsite/index.php
  3. Press Enter to navigate to the PHP website.
  4. You should see the message “Hello, World! This is a PHP website.” displayed on the webpage, indicating that XAMPP and PHP are working correctly.

Conclusion:

Congratulations! You have successfully installed XAMPP and tested its functionality by running a PHP website. You can now use XAMPP to develop and test PHP applications on your computer.

Leave a Comment

Hello world!

Welcome to Plymouth State University Blogs. This is your first post. Edit or delete it, then start blogging!

This post was edited on date 09/07/2022

This post was re-edited on date 02/01/2023

Comments (1)