Developer Documentation
For: Developers & System Administrators
This guide covers complete deployment of RMT Attendance System on cPanel shared hosting (like SyokHost) without SSH access.
System Requirements
Hosting Requirements
- Control Panel: cPanel (recommended: latest version)
- PHP Version: 8.1 or higher (8.2 recommended)
- Database: MySQL 5.7+ or MariaDB 10.3+
- Storage: 500MB minimum (1GB recommended)
- Memory: 512MB RAM minimum
- HTTPS: SSL certificate (required for camera access)
Required PHP Extensions
| Extension | Purpose | Required? |
|---|---|---|
| BCMath | Mathematical operations | ✅ Required |
| Ctype | Character type checking | ✅ Required |
| Fileinfo | File information detection | ✅ Required |
| JSON | JSON data handling | ✅ Required |
| Mbstring | Multibyte string support | ✅ Required |
| OpenSSL | Encryption and security | ✅ Required |
| PDO | Database connectivity | ✅ Required |
| PDO_MySQL | MySQL database driver | ✅ Required |
| Tokenizer | Code parsing | ✅ Required |
| XML | XML processing | ✅ Required |
| GD | QR code generation | ✅ Required |
| Curl | HTTP requests | ✅ Required |
| Zip | Archive handling | Recommended |
Installation Guide (cPanel)
Step 1: Upload Files to cPanel
1.1 Login to cPanel
- Access your hosting cPanel (e.g., yourdomain.com/cpanel)
- Enter your cPanel username and password
1.2 Open File Manager
- In cPanel, find and click "File Manager"
- Navigate to
public_htmlfolder
1.3 Prepare Project Structure
Create this structure:
public_html/
├── rmt-attendance/ ← All Laravel files EXCEPT public folder
│ ├── app/
│ ├── bootstrap/
│ ├── config/
│ ├── database/
│ ├── resources/
│ ├── routes/
│ ├── storage/
│ ├── vendor/
│ ├── .env
│ ├── artisan
│ └── composer.json
│
└── (public folder contents) ← Contents of 'public' folder go here
├── index.php
├── .htaccess
├── css/
├── js/
└── favicon.ico
1.4 Upload Project Files
- Create folder
rmt-attendanceinsidepublic_html - Zip your project files on your computer
- In File Manager, click "Upload"
- Upload the ZIP file to
public_html/ - Right-click the ZIP → "Extract"
- Move all files EXCEPT
publicfolder intormt-attendance/ - Move contents of
publicfolder directly topublic_html/
Step 2: Setup Database (PHPMyAdmin)
2.1 Create Database
- In cPanel, click "MySQL Databases"
- Under "Create New Database"
- Database Name:
rmt_attendance - Click "Create Database"
- Database Name:
2.2 Create Database User
- Scroll to "MySQL Users" section
- Create new user:
- Username:
rmt_user - Password: (create strong password)
- Click "Create User"
- Username:
2.3 Add User to Database
- Scroll to "Add User To Database"
- Select:
- User:
rmt_user - Database:
rmt_attendance
- User:
- Click "Add"
- On privileges page, check "ALL PRIVILEGES"
- Click "Make Changes"
- Database Name: cpanel_rmt_attendance (prefix may be added)
- Username: cpanel_rmt_user
- Password: (your password)
- Host: localhost
Step 3: Configure Environment File
3.1 Rename .env.example
- Go to
public_html/rmt-attendance/ - Find
.env.examplefile - Right-click → "Rename"
- Rename to
.env(remove .example)
3.2 Edit .env File
- Right-click
.env→ "Edit" - Update these values:
APP_NAME="RMT Attendance"
APP_ENV=production
APP_DEBUG=false
APP_URL=https://yourdomain.com
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=cpanel_rmt_attendance ← Your database name
DB_USERNAME=cpanel_rmt_user ← Your database username
DB_PASSWORD=your_password_here ← Your database password
SESSION_DRIVER=file
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
TIMEZONE=Asia/Kuala_Lumpur
- Set
APP_DEBUG=falsein production! - Set
APP_ENV=production - Keep
.envfile private (never commit to Git)
3.3 Generate Application Key
You need to generate APP_KEY. Use the helper file:
- Navigate to:
https://yourdomain.com/generate-key.php - Copy the generated key
- Paste in
.envfile:APP_KEY=base64:xxxxx - Delete
generate-key.phpafter use (security!)
3.4 Update index.php
Edit public_html/index.php:
<?php
// Change from:
require __DIR__.'/../vendor/autoload.php';
$app = require_once __DIR__.'/../bootstrap/app.php';
// To:
require __DIR__.'/rmt-attendance/vendor/autoload.php';
$app = require_once __DIR__.'/rmt-attendance/bootstrap/app.php';
?>
Step 4: Run Database Migrations
public folder!
4.1 Import Database Directly (Option A - Recommended)
- In cPanel, open "PHPMyAdmin"
- Select your database (e.g.,
cpanel_rmt_attendance) - Click "Import" tab
- Click "Choose File"
- Select
database.sqlfrom project files - Click "Go"
- Wait for import to complete
- Verify tables created (should see: users, students, menus, attendance_records, settings)
4.2 Use Helper File (Option B)
- Navigate to:
https://yourdomain.com/artisan-migrate.php - Click "Run Migration" button
- Wait for completion
- Check for success message
- Delete
artisan-migrate.phpafter use
4.3 Seed Demo Data (Optional)
- Navigate to:
https://yourdomain.com/artisan-seed.php - Click "Seed Database"
- Demo admin account and sample data will be created
- Delete
artisan-seed.phpafter use
Step 5: Create Storage Link
Laravel needs a symbolic link for file storage:
- Navigate to:
https://yourdomain.com/create-storage-link.php - Click "Create Storage Link"
- Success message should appear
- Delete
create-storage-link.phpafter use
- Visit:
https://yourdomain.com - Login with:
admin@rmt.com/admin123 - Change admin password immediately!
PHP Extensions Configuration
Checking Installed Extensions
- Create file
phpinfo.phpinpublic_html/:<?php phpinfo(); ?> - Visit:
https://yourdomain.com/phpinfo.php - Search for required extensions
- Delete file after checking!
Enabling Extensions in cPanel
Method 1: MultiPHP Manager (Recommended)
- In cPanel, find "MultiPHP Manager"
- Select your domain
- Click "System PHP Version"
- Verify PHP 8.1+ is selected
Method 2: Select PHP Version
- In cPanel, find "Select PHP Version"
- Choose PHP 8.1 or 8.2
- Click "Extensions" tab
- Enable required extensions:
- ☑ bcmath
- ☑ ctype
- ☑ fileinfo
- ☑ json
- ☑ mbstring
- ☑ openssl
- ☑ pdo
- ☑ pdo_mysql
- ☑ tokenizer
- ☑ xml
- ☑ gd
- ☑ curl
- Click "Save"
Helper Files Usage
Since you don't have SSH access, helper PHP files are provided to run Laravel artisan commands via browser.
Available Helper Files
| File | Purpose | URL |
|---|---|---|
| create-storage-link.php | Create symbolic link for storage | /create-storage-link.php |
| artisan-migrate.php | Run database migrations | /artisan-migrate.php |
| artisan-seed.php | Seed demo data | /artisan-seed.php |
| artisan-clear.php | Clear all cache | /artisan-clear.php |
| generate-key.php | Generate APP_KEY | /generate-key.php |
create-storage-link.php
What it does: Creates symbolic link from public/storage to storage/app/public
When to use: After initial installation, or if QR codes/images not displaying
Usage:
- Visit:
https://yourdomain.com/create-storage-link.php - Click button or page auto-runs
- See success/error message
- Delete file after use
artisan-clear.php
What it does: Clears all Laravel cache (config, route, view, application cache)
When to use:
- After updating
.envfile - System not reflecting changes
- Debugging issues
- After code updates
Usage:
- Visit:
https://yourdomain.com/artisan-clear.php - All caches cleared
- Refresh your site
- Delete file after use
artisan-migrate.php
What it does: Runs database migrations to create tables
When to use: Initial setup, or when adding new features that need database changes
Usage: Same as above
Subdomain Setup (Optional)
You can run RMT Attendance on a subdomain (e.g., attendance.yourdomain.com)
Create Subdomain in cPanel
- In cPanel, find "Subdomains"
- Enter subdomain name:
attendance - Document Root:
public_html/attendance(or custom path) - Click "Create"
Upload Project to Subdomain
- Navigate to subdomain folder (e.g.,
public_html/attendance/) - Follow same upload structure as main installation
- Update
.envwith subdomain URL:APP_URL=https://attendance.yourdomain.com
SSL Configuration
Free SSL with Let's Encrypt (cPanel)
- In cPanel, find "SSL/TLS Status"
- Select your domain
- Click "Run AutoSSL"
- Wait for certificate to be issued (few minutes)
- Verify SSL active (padlock icon in browser)
Force HTTPS (Redirect HTTP to HTTPS)
Edit .htaccess in public_html/:
# Add at the top, before other rules
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Existing Laravel rules below...
This ensures all visitors use HTTPS.
PHPMyAdmin Guide
Accessing PHPMyAdmin
- In cPanel, click "PHPMyAdmin"
- Database opens automatically
- Select your database from left sidebar
Common Tasks
Import Database
- Click "Import" tab
- Choose
database.sqlfile - Click "Go"
Export Database (Backup)
- Click "Export" tab
- Select "Quick" method
- Format: SQL
- Click "Go"
- Save file to your computer
View Tables
- Click database name in left sidebar
- Tables listed: users, students, menus, attendance_records, settings
- Click table name to browse data
Run SQL Queries
- Click "SQL" tab
- Enter SQL query
- Click "Go"
Example - Reset Admin Password:
UPDATE users
SET password = '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi'
WHERE email = 'admin@rmt.com';
-- Password will be: password
File Permissions
Required Permissions
| Folder/File | Permission | Recursive? |
|---|---|---|
| storage/ | 755 | ✅ Yes |
| bootstrap/cache/ | 755 | ✅ Yes |
| .env | 644 | ❌ No |
| All other files | 644 | ❌ No |
| All other folders | 755 | ✅ Yes |
Setting Permissions in cPanel
- Open File Manager
- Navigate to folder (e.g.,
rmt-attendance/storage/) - Right-click folder → "Change Permissions"
- Check boxes to set 755:
- Owner: Read, Write, Execute (7)
- Group: Read, Execute (5)
- World: Read, Execute (5)
- Check "Recurse into subdirectories"
- Click "Change Permissions"
Troubleshooting
Issue 1: White Screen / 500 Error
Causes:
- Incorrect
index.phppaths .envfile missing or misconfigured- Missing APP_KEY
- File permissions wrong
Solutions:
- Check
index.phppaths are correct - Verify
.envexists inrmt-attendance/folder - Generate APP_KEY using
generate-key.php - Set storage/ to 755 permissions
- Check error log: cPanel → "Errors" or
storage/logs/laravel.log
Issue 2: Database Connection Error
Error: "SQLSTATE[HY000] [1049] Unknown database"
Solutions:
- Verify database exists in PHPMyAdmin
- Check
.envdatabase credentials:- DB_DATABASE (include cPanel prefix if any)
- DB_USERNAME (include cPanel prefix)
- DB_PASSWORD (correct password)
- Verify user has privileges on database
- Clear cache:
artisan-clear.php
Issue 3: QR Codes Not Generating
Causes:
- GD extension not enabled
- Storage link not created
- Storage folder not writable
Solutions:
- Enable GD extension in "Select PHP Version"
- Run
create-storage-link.php - Set
storage/app/public/to 755 permissions - Check
phpinfo.php- search for "gd"
Issue 4: Camera Not Working in Scanner
Causes:
- Site not using HTTPS
- Camera permission denied
- Browser not supported
Solutions:
- Install SSL certificate (Let's Encrypt)
- Force HTTPS redirect in .htaccess
- Check browser allows camera (Chrome, Firefox, Edge)
- Grant camera permission when prompted
Issue 5: Excel Import/Export Not Working
Causes:
- Maatwebsite/excel package not installed
- Memory limit too low
- Execution time too short
Solutions:
- Verify
vendor/folder uploaded completely - Increase PHP limits in cPanel → "Select PHP Version" → "Options":
- memory_limit: 512M
- max_execution_time: 300
- upload_max_filesize: 10M
Issue 6: Changes Not Reflecting
Solution: Clear all cache using artisan-clear.php
Getting Detailed Error Messages
Temporarily enable debug mode:
- Edit
.env - Change
APP_DEBUG=falsetoAPP_DEBUG=true - Reproduce the error
- Read detailed error message
- IMPORTANT: Set back to
falseafter debugging!
Check Error Logs
Laravel Log:
- File Manager →
rmt-attendance/storage/logs/laravel.log - Download and read
Server Error Log:
- cPanel → "Errors"
- View recent errors
Still Having Issues?
Contact support with:
- Exact error message
- Steps to reproduce
- PHP version (from phpinfo.php)
- Enabled extensions list
- Relevant log entries
- Clear cache (
artisan-clear.php) - Check file permissions
- Verify .env configuration
- Check error logs
← Back to Documentation Home