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:
Step 3: Start Services
-
Open XAMPP Control Panel
-
Start:
-
Apache
-
MySQL
-
✔ Green indicator confirms successful start.
Step 4: Verify Installation
-
Open browser and type:
-
XAMPP dashboard should appear.
Step 5: PHP Configuration Check
-
Create a file
info.phpin: -
Write:
-
Open:
✔ 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:
Program Code
Step 2: Run the Program
-
Open browser
-
Type:
Output
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)
-
What is XAMPP?
→ A software package containing Apache, PHP, and MySQL. -
Default folder for PHP files in XAMPP?
→htdocs -
What does localhost mean?
→ It refers to the local computer. -
Which command checks PHP configuration?
→phpinfo() -
Which service runs PHP code?
→ Apache Web Server
Note for Examiner
-
Same steps apply for:
-
WAMP → Windows
-
LAMP → Linux
-
MAMP → macOS
-
Comments
Post a Comment