Installation Guide
Choose your setup method below. Each guide includes a video tutorial and detailed written instructions. Follow the steps carefully in order.
Download & Install XAMPP
XAMPP is a free software package that installs Apache (web server), MySQL/MariaDB (database), and PHP on your computer. This allows you to run PHP projects locally without any hosting.
- Go to the official XAMPP website and download the latest version for your operating system (Windows, macOS, or Linux)
- Make sure to download the version with PHP 8.0 or higher — this project requires PHP 8+
- Run the installer and keep all default settings — click Next through each screen
- Choose the installation directory (default is C:\xampp on Windows)
- Wait for the installation to complete and click Finish
Start Apache & MySQL Services
After installing XAMPP, you need to start two services that are required to run PHP projects:
- Apache — This is the web server that processes PHP files and serves your website in the browser
- MySQL — This is the database server that stores all your project data (users, settings, files, etc.)
Open the XAMPP Control Panel from your Start Menu or Applications folder. You will see a list of services. Click the Start button next to both Apache and MySQL. When they are running successfully, their names will turn green.
Listen 80 to Listen 8080 → Save and restart Apache. Your project URL will then be http://localhost:8080/ instead.
Open phpMyAdmin & Create a New Database
phpMyAdmin is a web-based tool for managing MySQL databases. You will use it to create an empty database for your project. Follow these sub-steps carefully:
- Open your web browser (Chrome, Firefox, Edge, etc.)
- Type http://localhost/phpmyadmin in the address bar and press Enter
- phpMyAdmin will open — you'll see a list of existing databases on the left sidebar
- Click "New" at the top of the left sidebar
- In the "Database name" field, type a name for your database (e.g. rameez_scripts)
- In the "Collation" dropdown, select utf8mb4_general_ci (this supports all languages and emojis)
- Click the "Create" button
Copy Project Files to XAMPP htdocs Folder
The htdocs folder is where XAMPP looks for your website files. Any folder you place inside htdocs becomes accessible in your browser at http://localhost/folder-name/.
- If you downloaded the project as a .zip file, first extract/unzip it
- Copy the entire extracted project folder
- Paste it into the htdocs directory
The htdocs location depends on your operating system:
Configure the .env File (Database Credentials)
The .env file is the environment configuration file that stores your database connection details. The project reads this file to know how to connect to your MySQL database. Open this file with any text editor (Notepad, VS Code, Sublime Text, etc.).
You will see these variables — update them with your database details:
Here's what each variable means:
- DB_HOST — The server where your database is running. For XAMPP, this is always
localhost - DB_NAME — The exact name of the database you created in phpMyAdmin (Step 3)
- DB_USER — The MySQL username. XAMPP's default is
root - DB_PASSWORD — The MySQL password. XAMPP's default is empty (no password), so leave it blank after the
=sign
= sign, and no quotes around the values. The format should be exactly DB_NAME=rameez_scripts with no spaces.
Run setup.php — Automatically Create All Database Tables
The setup.php script is included with the project. When you run it, it will automatically:
- Connect to your database using the credentials from the .env file
- Create all required database tables (users, files, settings, payments, etc.)
- Insert default configuration data and admin accounts
- Set up all indexes for optimal performance
To run it, open your browser and go to:
Wait for the script to finish. You should see green success messages for each table that was created.
Access Your Project — You're Done!
Your PHP project is now fully set up and running on your local computer. Open your browser and go to:
You should see the project's login page or homepage. Your project is now running locally and you can start using it!
Log in to Hostinger hPanel
Hostinger uses its own control panel called hPanel (not cPanel). This is where you manage your website, databases, files, and settings.
- Go to hpanel.hostinger.com in your browser
- Log in with your Hostinger account email and password
- You'll see a list of your websites/domains — click on the domain where you want to install this project
- This will open the dashboard for that specific website
Create a MySQL Database
You need to create a database on Hostinger's server to store all your project data. Follow these steps:
- In the left sidebar of hPanel, go to Databases → MySQL Databases
- Under "Create New MySQL Database and Database User", you'll see three fields:
- Database Name — type a name (e.g.
rameez_scripts). Hostinger will automatically add a prefix likeu123456789_ - Username — type a username. Hostinger will also add the same prefix
- Password — click Generate for a strong password, or type your own
- Click "Create"
u123456789_rameez_scripts), full username, and password. Copy all three and save them somewhere — you will need them in Step 4 for config.php.
u123456789_) to both the database name and username. You must use the full name with the prefix in your config file, not just the short name you typed.
Upload Project Files to Hostinger
The public_html folder on Hostinger is the root directory of your website — any files placed here will be accessible at https://yourdomain.com/. Here's how to upload your project:
- In hPanel, go to Files → File Manager
- Navigate to the public_html folder (click on it to open it)
- If you want the project at your main domain (yourdomain.com), upload files directly into public_html
- If you want it in a subfolder (yourdomain.com/project), first create a new folder inside public_html
- Click the Upload button (top toolbar) and select your project .zip file
- After the upload finishes, right-click on the .zip file and select "Extract"
- Make sure all files are in the correct directory (not nested in an extra subfolder)
Configure the config.php File (Database Credentials)
Unlike localhost where we edit the .env file, on Hostinger you need to update the config.php file with your database credentials. Here's how:
- In File Manager, find and open config.php (click on it, then click Edit in the top toolbar)
- Look for the database configuration section near the top of the file
- Update the four values with your Hostinger database credentials from Step 2:
Here's what each variable connects to:
- $host — The database server. On Hostinger, this is always
'localhost' - $dbname — The full database name including the Hostinger prefix (e.g.
u123456789_rameez_scripts) - $username — The full database username including the prefix
- $password — The database password you set or generated in Step 2
After editing, click Save (or press Ctrl+S) in the File Manager editor.
rameez_scripts) instead of the full name with prefix (e.g. u123456789_rameez_scripts). Always use the complete name as shown in hPanel after database creation.
Run setup.php — Automatically Create All Database Tables
Just like on localhost, the setup.php script will automatically create all the database tables your project needs. Open your browser and go to:
Wait for the script to finish processing. You should see green success messages confirming each table was created successfully.
localhost.
Access Your Live Project — You're Done!
Your PHP project is now live on the internet! Visit your domain to see it:
You should see the project's login page or homepage, now accessible to anyone on the internet.
https:// automatically.
Why Do You Need SMTP?
SMTP (Simple Mail Transfer Protocol) is the standard method for sending emails from a web application. Your PHP project uses email for several important features:
- Password Reset — When users forget their password, a reset link is sent via email
- Email Verification — Confirming that a user's email address is real and belongs to them
- Notifications — Sending alerts about new files, purchases, or account activity
- Contact Forms — Receiving messages from visitors who fill out your contact form
Without proper SMTP configuration, PHP's built-in mail() function will fail or emails will go straight to spam. SMTP uses authenticated servers (like Gmail or Hostinger) to send reliable emails that actually reach the inbox.
Generate a Gmail App Password
Gmail requires a special App Password for third-party applications (like your PHP project). You cannot use your regular Gmail password — it will be rejected for security reasons. Follow these steps:
- Go to myaccount.google.com and sign in to your Gmail account
- Click on Security in the left sidebar
- Under "How you sign in to Google", make sure 2-Step Verification is ON. If it's off, you must enable it first (Google requires this before allowing App Passwords)
- After enabling 2-Step Verification, go back to the Security page
- Search for "App Passwords" in the search bar at the top, or find it under 2-Step Verification settings
- Click on App Passwords
- Under "Select app", type a name like "My PHP Project"
- Click Create
- Google will show you a 16-character password (like
abcd efgh ijkl mnop). Copy this immediately!
Gmail SMTP Settings
Use these exact settings when configuring Gmail SMTP in your project:
What is TLS? TLS (Transport Layer Security) is an encryption protocol that secures the connection between your server and Gmail's server. Port 587 with TLS is Gmail's recommended method — it encrypts your email data during transmission so nobody can read it in transit.
Hostinger Email SMTP Settings
If you're hosting on Hostinger and have created an email account there (e.g. info@yourdomain.com), you can use Hostinger's own SMTP server instead of Gmail. This is recommended for production websites because emails come from your own domain, which looks more professional and has better deliverability.
Test Your Email Configuration
After configuring SMTP, you should test to make sure emails are being sent and received correctly:
- Try the password reset feature — enter your email on the forgot password page and check if you receive the reset email
- Try the contact form — send a test message and see if it arrives
- Check your inbox AND spam/junk folder — the first few emails might go to spam until your domain builds reputation
Common issues and fixes:
- Emails not sending at all — Double-check your SMTP host, port, username, and password. One wrong character will cause failure
- Emails going to spam — Configure SPF, DKIM, and DMARC DNS records for your domain. These prove to email providers that you're a legitimate sender
- "Authentication failed" error — For Gmail, make sure you're using the App Password (not your regular password). For Hostinger, verify the email account exists and the password is correct
- Connection timeout — Your hosting might block the SMTP port. Contact your hosting provider to unblock port 587 (Gmail) or 465 (Hostinger)
Need Help?
Stuck on any step? Contact us on WhatsApp for quick assistance or watch more tutorials on YouTube.