Moving your PHP project from your local
localhost(like XAMPP) to the live cloud takes about 3 minutes. You just need to move your files, move your database, and connect them together.
???? Phase 1: Move Your Files
-
On your computer, put all your project files (HTML, PHP, CSS) into a single
.zipfile. -
Log into cPanel and click on File Manager.
-
Open the
public_htmlfolder (this is the folder that connects directly to the internet). -
Click Upload at the top, upload your
.zipfile, and then right-click it to Extract. *(Note: Make sure your main page is namedindex.phporindex.html!)
????️ Phase 2: Move Your Database
-
Go back to the main cPanel screen and click MySQL Database Wizard.
-
Step 1: Name your new database (e.g.,
db_project1). -
Step 2: Create a new user and a strong password. (Copy this password to your notepad!)
-
Step 3: Check the box that says "All Privileges" to link the user to the database.
???? Phase 3: Connect Them
Your code is still looking for your old localhost credentials. Let's update them.
-
Go back to cPanel and open phpMyAdmin. Find your new database on the left side and click Import to upload your
.sqlfile from your computer. -
In the File Manager, find your database connection file (usually named
config.php,db.php, orconn.php) and click Edit. -
Update the credentials with the exact database name, username, and password you created in Phase 2.
Save the file, refresh your .in domain, and your app is live! ????