Developing a website on live server can be a nightmare for developer , specially when you are a beginner level programmer .Whenever a single edit made in a file it is require saving and refreshing on a live server .
It will going to take your lot of time .Situation get worse when your internet connection sucks .Here you can easily freak out and distracted .
So , what to do ?
To make development process fast as well smoth , it is better to setup a virtual server locally on your machine .Now you can develop your web app and run it on your local virtual server .Once you are convinced that your web app is ready now , next step is to deploy your website files and database on a live server.
“But how exactly I upload a website to a live server ?” .
That’s the same question I asked myself when I finished my php website .
2.Two ways you can deploy your website on your live server
Deploying your website to liver server is pretty straightforward nowadays . You don’t need to mess around linux ftp commands to upload or download your files from your remote server , although from point of view of a developer ,terminals are always the best choice to do this task .
If you are not fan of terminal ,then you can go for these two option to upload your website file and database to live server .
- Using your cpanel online file manager
- Using ftp client like filezilla
1.Using your hosting online file manager
Now a days every host provide his user with online file manager ,it is a graphical web based ftp client in-build in your cpanel
When you login to your admin panel ,you find your online file manager in file section .Note that ,different hosting provider different cpanel software , may be in your case dashboard layout not look as above picture depict .But you definitely find a file manager in there .
When you click on online file manager ,you will be redirect to your directory where all your website related files live .
This is a root dir , to upload your website files navigate to htdocs or www directory .All your website file uploaded in here .
Here you will find button to create new files ,directories and upload file option .Click on upload button you will be redirected to a form where you can start upload your files to your directory .
Using web based integrated ftp is pretty easy to use , but here you can see few restrictions as well .
- First one is that at a time you can only upload a single file .uploading a single file at a time seem boring and frustrating .Think you have 50 or 60 files to upload .
- Second is that size and time restrictions , you can only upload 2MB file in size .which stop you to upload your image file .
- If you trying to upload files on slow internet , it will take some time to upload .
When to use online file manager:
If you don’t have many file to upload ,you can use online file manager to upload your files .Online file manager also provide you a in-build file editor , so you don’t have to upload your file again when you made some minor changes in your code .
2. Using filezilla ftp client to deploy files to live server.
To upload multiple files at time we use a desktop software name filezilla .Filezilla is a popular ftp client(software) .There are other ftp client software do exist , but filezilla is super simple to use and have straightforward layout .
In case you wondering what is ftp? Let me clear this .
Ftp stand for file transfer protocol .ftp is set of rule which govern how are file transfer from client to our server .It is much like other protocol/rules like http ,smtp etc .
Here is the action step for you :
- download your filezilla ftp client .
- Get your ftp credentials .
- open your filezilla software .
- connect with your remote server.
- start uploading your files
Step-1: download filezilla
Here I will not cover the installation details .Installing filezilla on window is much like installing other softwares ,click click next next voila your software is installed . NO EXTRA CONFIGURATION NEEDED .
If you using ubuntu , you can check ubuntu official forum . click here
Step-2 : Get your FTP login credentials
You want able to upload your local files to your live server till you not connect with your web server .
To connect with your web server your host provide you ftp credentials ,which you can find in your control panel .
Click on manage tap .You will be redirect to another page ,where you can find your FTP credentials .
Now you have your ftp login details , you are ready to deploy your website .
Just fire up your filezilla client by double clicking on it .
Step-3 Connecting to remote web server using filezilla ftp client.
When you fire up your filezilla client you see a home like this .
At first , filezilla home dashboard seem overwhelming to beginners .
Filezilla home is divided into 4 sections :
- In this tap user provide all the login credentials to connect with remote web server .If supplied credentials are correct you will see a successful message just below this tap .
- In this tab you will see the hierarchical structure of directory of your local system . Just navigate to your desired directory .
- This tab initially empty , once you successfully connect with you web server you able to see the hierarchical directory structure of your web server .Here you upload your file .
- Here you see the status of your file . for instance if you transferring a file from your local directory tab to web server directory , a message flashed in this tab that transfer is complete .
- Step : 4 Uploading file from local directory to remote web server
Till now you did all the things required ,now you can start uploading your file . You only have to drag your file from local site tap to remote site tap only .
Once file uploaded successfully , a message displayed in bottom tab .
3.Importing your local database to your live web host database
Transferring files from localhost to remote web server is only a one side of coin , you application will not work till you import your local database to your live web server database .
Phpmyadmin facilitate us to import database and its tables to your live web server database .
But before you start importing your database to your live web server database , first you need to export all your tables in a file from your local database.
Here is your action steps :
- Open your phpmyadmin graphical database
- Navigate to your desired database ,you wish to import
- Now click on export button
- Confirm export
- A .sql file start downloaded , we will upload this file to our live database . rest of the heavy lifting done by our phpmyadmin database itself .
Now your database is exported from your local host .Its time to upload the exported file to your online database .Follow the steps below to upload your database to your live server database .
Here are your action steps :
- Login into your cpanel
- Navigate to mysql databases and create a empty database
- You will find phpmyadmin in database section on your cpanel dashboard.
- In phpmyadmin you will see a import option
- Click on import , phpmyadmin ask to upload a file
- Click on go and all your tables start to import on your live database.
Easy , isn’t ?
Phpmyadmin not allow to import file more than 50 MB in size .