PU Myeik LMS System is a PHP and MySQL classroom system with separate administrator, teacher, and student accounts. Teachers create classes, lectures, and assignments; students access their assigned class and submit work.
- PHP 8+
- MySQL / MariaDB
- Apache through XAMPP, or the PHP development server
- A database named
learnhub_v2
Import learnhub_v2.sql with phpMyAdmin (or MySQL) before using the application. The application now uses the V2 course and student_course tables, so students can be enrolled in more than one course.
Update the database connection in dbConnect.php if your local MySQL username, password, or database name differs.
From this project directory:
php -S localhost:8000Then open http://localhost:8000.
Admin credentials are read from environment variables instead of being stored as a readable password in source code.
- Choose a strong admin password.
- Generate its password hash:
php -r "echo password_hash('YourStrongPassword123!', PASSWORD_DEFAULT), PHP_EOL;"- Copy the generated hash and set the two permanent Windows environment variables:
setx LEARNHUB_ADMIN_USERNAME "admin"
setx LEARNHUB_ADMIN_PASSWORD_HASH "PASTE_THE_GENERATED_HASH_HERE"- Close and reopen PowerShell, then restart the PHP server or Apache.
Log in using the username and readable password you chose. Do not enter the hash in the login form.
To change the admin password later, generate a new hash and run the second setx command again.
- Log in as administrator and create teacher and student accounts, choosing each student's academic year.
- Log in as a teacher and create a course, selecting its academic year. All existing students in that year are enrolled automatically.
- Students created later are automatically enrolled in all existing courses for their selected year.
- Teacher adds lectures or assignments.
- Student logs in, opens an enrolled course, and submits a permitted document.
- Teacher opens Check Student Work from that course.
- Passwords created or changed by the application use
password_hash(). - Existing teacher and student readable passwords are upgraded to hashes after the next successful login.
- Role checks protect admin, teacher, and student areas.
- CSRF tokens protect important form submissions and logout.
- Student classroom access is restricted to the student's assigned class.
- Teacher work review is restricted to the selected class.
- Uploaded documents receive random filenames, have a 10 MB limit, and only allow: PDF, DOC, DOCX, PPT, PPTX, TXT, and XLSX.
The application blocks new PHP uploads. Review any old .php files in uploads/assignment and uploads/lecture; delete them only if they are not required coursework.