Installation
This guide walks you through installing the QR Attendance System on your server.Prerequisites
Before you begin, ensure your server meets these requirements:Required software
-
PHP 7.4 or higher with the following extensions:
pdo_mysql- Database connectivitygd- Image processing for QR codesfileinfo- File type detection for Excel importsmbstring- Multi-byte string handling
- MySQL 5.7 or higher or MariaDB 10.2 or higher
- Web server: Apache 2.4+ or Nginx 1.18+
- Composer - PHP dependency manager
Browser requirements
For QR code scanning functionality:- Modern browser with camera access support (Chrome, Firefox, Safari, Edge)
- HTTPS connection (required for camera access)
Installation steps
Install dependencies
Install required PHP packages using Composer:This will install:
phpoffice/phpspreadsheet- Excel file handling for student import/export
Configure database connection
Edit
config.php to set your database credentials:config.php
The system will automatically create all required tables when you first access the application.
Create the database
Create a new MySQL database:The application will automatically create all required tables on first run, including:
students- Student records and QR codesteachers- Teacher accountsadmins- Administrator accountsclasses- Class definitionsclass_students- Student-class enrollmentsclass_schedules- Class schedules and timingattendance- Attendance records
Configure web server
Point your web server document root to the application directory.Apache configuration example:Nginx configuration example:
Default credentials
The system creates a default administrator account on first run:- Username:
admin - Password:
admin123
SSL/HTTPS setup (recommended)
For camera access in QR scanning, you need HTTPS. Use Let’s Encrypt for free SSL certificates:Verification
Verify your installation by checking:- Database connection: Access the application - if you see the login page, database connection is successful
- Dependencies: Try registering a student - QR code should generate
- Camera access: Login as a teacher and open the scanner - browser should request camera permission
Troubleshooting
Database connection failed
- Verify MySQL service is running:
sudo systemctl status mysql - Check database credentials in
config.php - Ensure database exists:
SHOW DATABASES;
QR code not generating
- Check that GD extension is installed:
php -m | grep gd - Clear browser cache and reload
- Check browser console for JavaScript errors
Camera not accessible
- Ensure site is served over HTTPS
- Check browser permissions for camera access
- Verify camera is not in use by another application
Excel import/export not working
- Verify Composer dependencies are installed:
composer install - Check that
fileinfoPHP extension is enabled - Ensure upload directory has write permissions
Next steps
Now that installation is complete:- Follow the quickstart guide to configure your first class
- Read the teacher guide to learn about class management
- Review security configuration for production deployment
Quick Start
Set up your first class
Security Configuration
Secure your installation