How to install WordPress in your localhost using xampp
Hey there! today I show you, how to install WordPress in your localhost or testing server. Assuming you already have xampp installed (otherwise, download here! and install it first ).
1) Create yoursite folder in htdocs
Now, go to your xampp folder, then htdocs, and create a new folder. Give a name whatever you want. I just called it “mysite” (C:\xampp\htdocs\mysite). Now you can minimize the window.
2) Download WordPress from the repository (wordpress.org)
Open an internet browser and type https://wordpress.org/download/ and download the latest WordPress version! which is WordPress 5.7.2 at the time of this article. Please read the requirements for the new version.
3) Extract the downloaded zip file to yoursite root
Now Open your download folder and extract the WordPress zip file into the newly created folder. Just computer – “c” drive – then “xampp” folder – then “htdocs”. and find your folder (“mysite” for my case).
Make sure the extracted WordPress files are in the root of your site folder (“mysite”). Now go to your “(C:\xampp\htdocs\mysite)” directory and check the folder, are there any WordPress files or folders there? Now check and confirm.
Just in case you have two extra levels, you must go back 2 levels. just move all of the folder and files to the root of yoursite folder “mysite”. This is the path “(C:\xampp\htdocs\mysite)”. and delete the empty WordPress folder. https://infinitydomainhosting.com/web-hosting.php
Remember! always keep your folder clean. It is better for security. No need to keep extra folders or files there. Except for the 19 WordPress items. It is WordPress files and folders.
4) Open Xampp Control Panel and Start “apache” & “mysql”
It is very important. Go to the xampp control panel and start “Apache” and “MySQL”, then “phpMyAdmin” and “logon”. I am log in. Create a new “database”, I will name mine “mysite_db”.
Will use the WordPress default values for username “root” and blank password “” (username:”root” and password:””). Don’t do this if you plan to transfer your site to a live server, you must create a username and strong password. it must be strong.
You can create your password what you want. don’t make your password easy, I can’t emphasize this enough. If your password is not strong. The site will be hack within seconds. I strongly suggest you use a password generator. Now take note of the following database details you just created will need them in the next step;
DB_NAME: “mysite_db” // database_name must be single word. No spaces allowed
DB_USER: “root” // This is WordPress defualt username. Note recommended for use in a live enviroment
DB_PASSWORD: “” // Default WordPress root password is blank
$table_prefix = ‘mysite_’ // Never use “wp_” it is not secure.
5) Rename wp_config_sample.php to wp_config.php
Now lets go to site folder and locate wp_config_sample.php and rename it to just wp_config.php. Open the newly renamed “wp_config.php” using notepad or any other text editor and edit the database section with your values created above;
For my example,
define( ‘DB_NAME’, ‘mysite_db’ );
/** MySQL database username */
define( ‘DB_USER’, ‘root’ );
/** MySQL database password */
define( ‘DB_PASSWORD’, ” );
$table_prefix = ‘mysite2021_’; // * WordPress Database Table prefix.
Keep everything else default for now save and exit
6) Install WordPress
Now open your browser (chrome/firefox, etc) and type in the address bar “localhost/mysite” and press Enter on your keyboard to launch the WordPress installation wizard. Follow the wizard instructions. Give the site title name. whatever you like. my site name “My Demo Website” and choose your login username and password.
Note that, this is different from the database username and password we created earlier. Again here you need to choose a very strong password so that you suffer from brutal attacks. Add your email and Double-check your email address before continuing.
Check “Discourage search engines from indexing this site” if you’re working on localhost. Remember when you go live, you must uncheck it otherwise yoursite will not be indexed by the search engines.
Now click “Install WordPress”.
WordPress will redirect you to “WordPress has been installed. Thank you, and enjoy!” success! Screen.
Go ahead, type your username and your login password.
7) Change Permalink Settings to “Post name”
It is important for SEO. Search engine optimization. by default, it is “Day and name” but change it to “Post name” and “Save Changes”. You’ll see something like “Permalink structure updated.”
All should be working fine by now! yes. Go ahead and preview (http://localhost/mysite/). You’ll be welcomed by the default “Hello world!
Welcome to WordPress. This is your first post. Edit or delete it, then start writing!”.