How to install WordPress in localhost:
first, you should install the XAMPP server
If you want to install WordPress in your localhost first you need WordPress file go to the wordpress.org and download the latest version of WordPress file.
click this link
The WordPress-5.0.2 is the latest ver of WordPress right now.
Now go to the WordPress zip file extract it to copy the folder
And go to the folder C: drive then the XAMPP folder and then htdocs folder paste the file here.
Change the file name what you want
Like if you want to make a demo website suppose our project name is demo-site then we make the folder name demo-site.
Now you create the folder name demo-site then you need a MySQL database file for your WordPress site
First, you check your XAMPP control panel is running and you Apache and MySQL is started when you go to the direct browser and type
Just click MySQL Admin button in your xampp control panel
Now go to the database tab.
Put a name in create database column (you can give any name for your database)
Click Create button but it is a unique name for every database
After database creation, you visit your demo-site
Go to the http://localhost/demo-site/
You should see the normal WordPress installer select the language and press continue
Now put the database name
your username should be root
Password leave it blank
Database host localhost by default
And table prefix wp_ by default
Run The Installation
Now you see the next page
Fill some information here
Site title your site name what you want
Your username your name what you want
Your password password@123 what you want
If your password is weak then check the checkbox
Unique email ID
Search Engine visibility if you want to discourage search engine check the checkbox if not leave it
Now click install WordPress
Next screen is the success screen click that login button
Now you found the login screen put username and password and press the login button for the dashboard or the http://localhost/demo-site/
See your website
Now you see your WordPress installation is complete and your WordPress site running perfectly on your localhost
Also, see Lifecycle