Practical - 1 IWD

 Aim

To install and configure PHP, Web Server, and MySQL database using XAMPP / WAMP / LAMP / MAMP and create a web page to display “Hello World”.


Software Required

  • XAMPP / WAMP / LAMP / MAMP

  • Web Browser (Chrome / Firefox)

  • Text Editor (Notepad / VS Code)


Theory

  • PHP is a server-side scripting language.

  • Apache is a web server.

  • MySQL is a relational database.

  • XAMPP / WAMP / LAMP / MAMP are software packages that provide:

    • Web Server (Apache)

    • PHP

    • MySQL

    • phpMyAdmin


Installation and Configuration Steps

Using XAMPP (Windows / Linux / macOS)

Step 1: Download XAMPP

  • Download XAMPP installer from official website.

  • Run the installer and select:

    • Apache

    • MySQL

    • PHP

    • phpMyAdmin


Step 2: Install XAMPP

  • Follow installation wizard.

  • Default installation path:

    C:\xampp\

Step 3: Start Services

  • Open XAMPP Control Panel

  • Start:

    • Apache

    • MySQL

✔ Green indicator confirms successful start.


Step 4: Verify Installation

  • Open browser and type:

    http://localhost
  • XAMPP dashboard should appear.


Step 5: PHP Configuration Check

  • Create a file info.php in:

    C:\xampp\htdocs\
  • Write:

<?php phpinfo(); ?>
  • Open:

http://localhost/info.php

✔ PHP configuration page confirms PHP is working.


Program: Hello World Using PHP

Step 1: Create PHP File

  • Open Notepad

  • Write following code

  • Save as hello.php inside:

    C:\xampp\htdocs\

Program Code

<?php echo "Hello World"; ?>

Step 2: Run the Program

  • Open browser

  • Type:

http://localhost/hello.php

Output

Hello World

Result

PHP, Apache Web Server, and MySQL database were successfully installed and configured using XAMPP, and a web page displaying “Hello World” was executed successfully.


Viva Questions (Common in Practical Exam)

  1. What is XAMPP?
    → A software package containing Apache, PHP, and MySQL.

  2. Default folder for PHP files in XAMPP?
    htdocs

  3. What does localhost mean?
    → It refers to the local computer.

  4. Which command checks PHP configuration?
    phpinfo()

  5. Which service runs PHP code?
    → Apache Web Server


Note for Examiner

  • Same steps apply for:

    • WAMP → Windows

    • LAMP → Linux

    • MAMP → macOS

Comments

Popular posts from this blog

Unit I - Introduction to PHP

Practical - 10 IWD