This guide will walk you through every step needed to set up and run this PHP web application on your computer using XAMPP and Microsoft SQL Server (SSMS). Follow each step carefully and in order.
Before you start, make sure you have these installed on your computer:
| Software | What it does |
|---|---|
| XAMPP | Runs PHP and Apache on your local computer |
| SQL Server Express | The database engine (comes with SSMS) |
| SQL Server Management Studio (SSMS) | The tool you use to manage your database |
β οΈ Important: XAMPP does not support SQL Server by default. You need to install extra drivers (called PHP SQLSRV Drivers) before anything will work. The steps below will guide you through this.
The ODBC Driver allows PHP to "talk" to SQL Server.
- Open your web browser and go to the official Microsoft website.
- Search for "Microsoft ODBC Driver for SQL Server download".
- Download the x64 version (this is for 64-bit Windows, which most computers use today).
- Run the downloaded
.msiinstaller and follow the on-screen instructions to complete the installation.
You need to know your PHP version so you can download the correct driver.
-
Open the XAMPP Control Panel.
-
Click the "phpinfo" button at the top right of the control panel.
If you don't see this button, open your browser and go to:
http://localhost/dashboard/phpinfo.php -
A page will open. Look near the top for a line that says something like:
PHP Version 8.2.x or PHP Version 8.3.x -
Write down your PHP version number (e.g.,
8.2). You will need it in the next step.
-
Go to the Microsoft website and search for "Microsoft Drivers for PHP for SQL Server download".
-
On the download page, find the version that matches your PHP version (e.g., if your PHP is
8.2, download the driver forPHP 8.2). -
Download the
.zipfile and extract/unzip it to a folder on your Desktop. -
Inside the extracted folder, you will see many
.dllfiles. You need to find exactly these two files:php_sqlsrv_XX_ts_x64.dll php_pdo_sqlsrv_XX_ts_x64.dllπ Note: Replace
XXwith your PHP version digits. For example, if your PHP is8.2, the files will be namedphp_sqlsrv_82_ts_x64.dllandphp_pdo_sqlsrv_82_ts_x64.dll.β Make sure you pick the files with
_ts_x64in the name. Thetsmeans "Thread Safe" andx64means 64-bit. These are the correct ones for XAMPP. -
Copy both
.dllfiles. -
Paste them into this folder on your computer:
C:\xampp\php\ext\
Now you need to tell XAMPP to actually use the drivers you just installed.
-
Open the XAMPP Control Panel.
-
Find Apache in the list and click the "Config" button next to it.
-
A small menu will appear. Click on "PHP (php.ini)". This will open a text file in Notepad.
-
Press Ctrl + F to open the search box and search for the word:
extension= -
Scroll to find the section that lists other extensions. Add these two new lines at the end of that section:
extension=php_sqlsrv_XX_ts_x64.dll extension=php_pdo_sqlsrv_XX_ts_x64.dllπ Remember: Replace
XXwith your actual PHP version digits (e.g.,82for PHP 8.2).Example (if your PHP version is 8.2):
extension=php_sqlsrv_82_ts_x64.dll extension=php_pdo_sqlsrv_82_ts_x64.dll -
Press Ctrl + S to save the file, then close Notepad.
-
Go back to the XAMPP Control Panel and click "Stop" then "Start" next to Apache to restart it.
β The drivers are now installed and enabled!
The htdocs folder is where XAMPP looks for websites on your computer.
- Find the project folder named
tutionManagementSystem(this was given to you). - Move or copy the entire folder to:
C:\xampp\htdocs\ - After this step, the path should look like:
C:\xampp\htdocs\tutionManagementSystem\
You need your computer's SQL Server name to connect the project to your database.
- Open SQL Server Management Studio (SSMS).
- When it opens, a "Connect to Server" login box will appear immediately.
- Look at the "Server name:" field at the top of that box.
- It will show something like one of these examples:
LAPTOP-XXXXX\SQLEXPRESSDESKTOP-XXXXX\SQLEXPRESSlocalhost\SQLEXPRESSlocalhost
- Write down or copy whatever is shown there β this is your Server Name.
Now you will tell the project how to connect to your SQL Server.
-
Open the project folder at
C:\xampp\htdocs\tutionManagementSystem\. -
Find the file named
db.phpand open it with Notepad (right-click β Open with β Notepad). -
You will see this code:
<?php $serverName = "YOUR_COMPUTER_NAME\SQLEXPRESS"; $connectionInfo = array( "Database" => "tution_db", "UID" => "", "PWD" => "" ); $conn = sqlsrv_connect($serverName, $connectionInfo); if ($conn === false) { die(print_r(sqlsrv_errors(), true)); } ?>
-
Replace
YOUR_COMPUTER_NAME\SQLEXPRESSwith the Server Name you found in Step 6.Example: If your server name is
LAPTOP-ABC123\SQLEXPRESS, the line should look like:$serverName = "LAPTOP-ABC123\SQLEXPRESS";
-
The
UIDandPWDfields can stay empty if you are using Windows Authentication (which is the default for most local setups). -
Save the file (Ctrl + S) and close Notepad.
- Open SQL Server Management Studio (SSMS) and connect to your server.
- On the left side, you will see a panel called "Object Explorer".
- Right-click on "Databases" and select "New Database...".
- In the box that appears, type the database name exactly as it is written in your
db.phpfile:tution_db - Click OK. You will now see
tution_dbappear in the Databases list.
The project comes with a .sql script file that automatically creates all the required tables.
- Open your project folder at
C:\xampp\htdocs\tutionManagementSystem\. - Find the file ending in
.sql(it may be named something liketution_db.sqlordatabase.sql). - Open it with Notepad and select all the text (Ctrl + A), then copy it (Ctrl + C).
- Go back to SSMS. Click on "New Query" button at the top.
- Make sure the dropdown at the top shows
tution_dbas the selected database. - Paste the copied SQL code into the query window (Ctrl + V).
- Click the "Execute" button (or press F5).
- You should see a message saying "Command(s) completed successfully" at the bottom.
β All the tables are now created in your database!
- Open the XAMPP Control Panel.
- Click "Start" next to Apache.
- The status should turn green.
π You do NOT need to start MySQL β this project uses SQL Server (SSMS), not MySQL.
- Open any web browser (Chrome, Firefox, Edge, etc.).
- In the address bar, type:
http://localhost/tutionManagementSystem/ - Press Enter.
π The Tuition Class Management System should now load and be ready to use!
| Problem | What to check |
|---|---|
| Page shows a blank screen or PHP errors | Make sure Apache is started in XAMPP |
| "Could not connect to SQL Server" error | Double-check your Server Name in db.php (Step 7) |
PHP errors about sqlsrv not found |
Make sure the .dll files are in C:\xampp\php\ext\ and the lines are added to php.ini (Steps 3β4) |
| Tables don't exist error | Make sure you ran the .sql script in SSMS (Step 9) |
| Apache won't start | Another program may be using Port 80. Try changing the Apache port in XAMPP Config. |
Use this checklist to make sure you have done everything:
- Installed Microsoft ODBC Driver (Step 1)
- Checked PHP version in XAMPP (Step 2)
- Downloaded and copied the two
.dlldriver files toC:\xampp\php\ext\(Step 3) - Added the two
extension=lines tophp.iniand restarted Apache (Step 4) - Moved the project folder to
C:\xampp\htdocs\(Step 5) - Found your SQL Server Name from SSMS (Step 6)
- Updated
db.phpwith your Server Name (Step 7) - Created the
tution_dbdatabase in SSMS (Step 8) - Ran the
.sqlscript to create all the tables (Step 9) - Started Apache in XAMPP (Step 10)
- Opened
http://localhost/tutionManagementSystem/in your browser (Step 11)