• 01Home
  • 02About Us
  • 03Blogs
  • 04Product Reviews
  • 05My Quizzes
  • 06Login
  • 07Signup

1 – WordPress Hosting : On Fresh Windows Server VM

Search Now
  • Step 0 : Download Microsoft Visual C++ Redistributable

    Do this step if you are getting: VCRUNTIME140.dll was not found, during any of below steps.

    Go to the official Microsoft page:

    🔗 https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist

    Scroll to: Visual Studio 2015, 2017, 2019, and 2022

    Download this file:

    👉 vc_redist_x64.exe (for 64-bit systems)

    Run the .exe file you downloaded

    Accept the license and install

    Restart your computer (recommended, though not always necessary)

    Step1: Download And Start Nginx

    Official site: https://nginx.org/en/download.html

    Extract to C:\nginx

    Open Command Prompt, run:

    cd C:\nginx
    start nginx

    Visit http://localhost → You’ll see the Nginx welcome page.

    Step2: Install PHP

    Download PHP:

    • https://windows.php.net/download/
    • Get Thread Safe x64 version
    • extract to C:\php

    Edit PHP Config:

    • Copy php.ini-development → php.ini
    • Enable necessary extensions:

    To eanble extension “mysqli” search for line in php.ini:

     ;extension=mysqli

    and remove ” ;” from the beginning

    Repeat this process for other useful extensions:

    ExtensionWhat It Does
    mysqliEnables MySQL database connection
    mbstringHandles multi-byte strings (used by WordPress and plugins)
    curlAllows PHP to make HTTP requests (used by APIs)
    opensslNeeded for HTTPS and secure connections
    gdFor image manipulation
    zipFor working with ZIP files (plugins, backups, etc.)

    If you don’t see these lines

    Go to your PHP directory:

    C:\php\ext

    Look for the corresponding files:

    DLL FileExtension
    php_curl.dllcurl
    php_openssl.dllopenssl
    php_gd.dllgd
    php_zip.dllzip

    If these files exist → you’re good to enable them.

    Just add the lines manually to the php.ini file

    extension=curl
    extension=openssl
    extension=gd
    extension=zip


    Step3: Start PHP in FastCGI mode

    This is necessary because you’re using Nginx, and Nginx cannot run PHP by itself — it sends .php files to PHP via something called FastCGI.

    Open Command Prompt and run:

    C:\php\php-cgi.exe -b 127.0.0.1:9000

    Keep this window open — it runs the PHP processor in the background.

    Check if PHP is successfully listening on port 9000

    In Command Prompt:

    netstat -ano | find ":9000"

    If PHP is running properly, you’ll see something like:

    TCP 127.0.0.1:9000 0.0.0.0:0 LISTENING [PID]

    Edit nginx.conf to handle .php files

    Nginx needs to know that .php files should be sent to the PHP processor.

    Go to:

    C:\nginx\conf\nginx.conf

    Find the server {} block and add this inside (or uncomment it if it’s already there):

    location ~ .php$ {
        root html;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }

    💾 Save the file.

    Restart Nginx

    So it picks up the new config changes.

    In Command Prompt:

    taskkill /F /IM nginx.exe
    start C:\nginx\nginx.exe

    Or:

    cd C:\nginx
    start nginx

    Verify if PHP is working properly with Nginx

    Create a test PHP file

    Go to: C:\nginx\html

    Create a file named: info.php

    Put this inside:

    <?php phpinfo(); ?>

    Open your browser and visit: http://localhost/info.php

    Step 4 : Download and Extract WordPress Files

    Download WordPress

    • Go to https://wordpress.org/download/
    • Download the latest WordPress ZIP file

    Extract WordPress

    • Extract the contents of the ZIP file into your Nginx web root folder: C:\nginx\html\

    It should create a folder like: C:\nginx\html\wordpress\

    Create a MySQL database for WordPress

    Why do you need a MySQL database?

    WordPress stores all your website’s data — posts, users, settings, and more — in a database.

    MySQL (or MariaDB) is a database server that stores this data.

    When you install WordPress, it needs a database to save everything.

    So you need to:

    1. Install a database server (MySQL or MariaDB) on your Windows machine if you don’t have it already.
    2. Create a database inside that database server specifically for WordPress.
    3. Create a user that WordPress will use to access this database.
    4. Tell WordPress the database name, user, and password in its config file (wp-config.php).

    You can download MySQL Community Server here:

    https://dev.mysql.com/downloads/mysql

    The MySQL Installer’s MySQL Configurator (part of the MySQL Installer for Windows) helps you set up your MySQL Server easily with a GUI.

    Set the root password

    • The Configurator will ask you to create a root user password — this is the admin account for your MySQL server.
    • Choose a strong password and remember it. You’ll need it to manage databases later.

    Configure MySQL as a Windows Service

    • The Configurator lets you choose to run MySQL as a Windows service.
    • Keep the option “Start MySQL Server at System Startup” checked so MySQL starts automatically.

    How to find the correct MySQL service name:

    Run this command to list all services and filter ones with “mysql”:

    sc query state= all | findstr /I mysql

    It will give something like:

    SERVICE_NAME: MySQL93
    DISPLAY_NAME: MySQL93

    To check if it’s running:

    sc query MySQL93

    To start the service if it’s stopped:

    net start MySQL93

    To stop the service (if needed):

    net stop MySQL93

    Now, to connect to MySQL via command line:

    mysql -u root -p

    Common Error:

    ‘mysql’ is not recognized as an internal or external command,
    operable program or batch file.

    Solution is to go to pull path:

    cd “C:\Program Files\MySQL\MySQL Server 9.3\bin”

    or Permanently add MySQL to your system PATH

    Connect to MySQL to create your WordPress database

    Open a new Command Prompt window (or keep the current one, up to you).

    mysql -u root -p

    Enter your root password when prompted.

    Inside the MySQL prompt, create the database with this SQL:

    CREATE DATABASE wordpress_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

    Then exit MySQL prompt:

    EXIT;

    That creates a fresh database named wordpress_db for WordPress.

    Start the WordPress installer

    Go to:

    http://localhost/wordpress

    You should see the WordPress installation wizard!

    Now just follow the WordPress installation wizard:

    1. Language: Choose your preferred language → Click Continue.
    2. Database setup:
      • Database Name: wordpress_db
      • Username: root
      • Password: (your root password)
      • Database Host: localhost
      • Table Prefix: leave as wp_ unless you want to customize
    3. Click Submit, then Run the installation.
    4. Fill in site title, admin username/password, email, etc.

    WordPress will be installed, and can be access via: http://localhost/wordpress

    After Restarting VM

    After Restarting VM, we may need to start following process for WordPress to run again

    1 – Start Nginx

    cd C:\nginx
    start nginx

    2 – Start PHP processor

    C:\php\php-cgi.exe -b 127.0.0.1:9000

    3 – Start MySQL

    net start MySQL93

    Reset WordPress Admin Password

    In case you forget WordPress admin password.

    Navigate to your MySQL bin folder

    cd “C:\Program Files\MySQL\MySQL Server 9.3\bin”

    Run MySQL:

    mysql -u root -p

    USE wordpress_db;
    SELECT ID, user_login FROM wp_users;
    UPDATE wp_users SET user_pass = MD5(‘yournewpassword’) WHERE user_login = ‘admin’;
    EXIT;

    alan

    June 10, 2025
    wordpress-hosting
Full logo
  • About Us
  • Contact us
  • Blogs
  • Privacy policy
  • Terms

As amazon associate we earn commission from qualifying sales. Built by Alan Tech Blogs Product Reviews and Technical Quizzes. Copyright © by Alan.

Proudly Powered by WordPress