How to Upload PHP website on cPanel with database

In this blog we will learn how to upload php website on cpanel with mysql database, this is an important topic mostly developer develop their website on local server easily but they don’t know how to setup php website with database on live server. Let’s see the following steps:

Step1:  Compress your project in zip format.

Step2: Open your cpanel of web hosting, In cpanel open file manager



Step3:
DoubleClick on public_html



Step4:
If you have single website hosting then click on upload button and upload your zip file of project which you have compressed, if you have multiple websites hosting means you have hosted multiple website on single cpanel then you have to upload zip in your domain name directory.


Step5:
After completion of upload zip file extract it.


Step6:
Go back to cpanel main screen, create database for website, click on mysql database wizard.


Step7: 
After opening mysql database wizard, screen appear to create database , enter database name whatever you want or you have used on local server, save database name in your notepad file , it will use on connection.php file further.


Step8:
Create Database user and password.


Step9:
Check all privileges, click on next step button. You will see the completed task.


Step10.
Open your connection.php file or file where you have mentioned database detail enter the user name , password, and database name which you have created through mysql database wizard.

Example:

<?php
$servername = "localhost";
$username = "root";
$password = "";
$db="phpclass4thnew"; // Create connection
$conn = mysqli_connect($servername, $username, $password,$db); // Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
//echo "Connected successfully";
?>
Categories: web development php
Written By : Web Development Institute
Trending Courses

CodeIgniter

Regular : 45 Days

Fastrack : 20 Days

Crash : 10 Days

Advance Digital Marketing Expert Course

Regular : 6 Months

Fastrack : 3 Months

Crash : 2 Months

React JS

Regular : 45 Days

Fastrack : 25 Days

Crash : 15 Days

Laravel

Regular : 45 Days

Fastrack : 20 Days

Crash : 10 Days

Front End Developer

Regular : 6 Months

Fastrack : 4 Months

Crash : 2 Months

Web Expert with Python

Regular : 12 Months

Fastrack : 6 Months

Crash : 3 Months

Related Blogs

Request For Demo