How to host PHP website on Hostinger

Published 14 August 2023 by Jarvis Silva

Made a website using php want to host it then Hostinger is the best web hosting to host your php website and in this tutorial we will see how to host php website on Hostinger.

Hostinger is one cheapest web hosting out there for php made websites, In this tutorial we will host our php website on hostinger's shared hosting plan which provides great features at low cost you can also see other hosting plan of Hostinger if you want.

You can use our web hosting cost calculator to analyze pricing plans of multiple web hostings including Hostinger. So now without wasting any more time let's host our php website.

1. Create an Hostinger account

  • Use this Hostinger discount link and get around 50-70% discount on premium web hosting plan of Hostinger.
  • Choose a hosting plan that suits your needs. The Premium Single Shared Hosting plan is a great starting point for small projects, You can host multiple websites and also get a free domain.
  • Complete the registration and checkout process.

2. Setting up domain

  • Login to Hostinger hpanel.
  • If you had purchased the premium shared hosting plan you would get a free domain you can use it or add a domain from other domain providers.
  • If you are using domain from another provider then you need to point the domain nameservers to hostinger nameservers follow this guide: point domain to Hostinger.

3. Uploading your php code to Hostinger server

After setting up domain follow the below steps:

  • Go to Hostinger dashboard of the website.
  • Under files section click files and under that click on file manager.
  • Hostinger file manager tab
  • Now click on access all files of your website.
  • It will open the file manager, in that there will public_html folder you need enter all your php code inside it.
  • Now go inside the public_html folder.
  • Now zip your entire php code folder.
  • Drag and drop the zip folder inside public_html folder.
  • Right click on the zip folder and click extract.

Now if you visit your website at your domain you should see your website running but if you are using a mysql database you will see a database error then you need to create one in Hostinger and connect it to your php website, Hostinger provides free mysql database which you can use so let's see how to configure it.

Read: Host next js website on Hostinger.

Configure database

Now this only applicable if your website is using mysql database so follow the below steps to configure your database:

  • In your Hostinger dashboard go to database section and click management you should see below page.
  • Hostinger databases section
  • Create a new database by entering your database name, username and password.
  • New database will be created for you can click phpmyadmin and create your tables or import your existing database.
  • Make sure your name and password you used for creating a database at Hostinger is same in your php website code.

Now if you followed every step properly and visit your website you should see your website working and if you still see errors and cannot get your php website running contact Hostinger support they will help you host your website.

I hope you found this tutorial helpful and you were able to host your php website in Hostinger successfully thank you for reading Happy hosting :)

About the author

I am Jarvis Silva, a tech-savvy individual. I have 5 years of experience in website hosting and development, Now sharing all my knowledge related to web hosting and other various technologies on the internet through Hostwizly.