How to Setup Apache, PHP & MySql on Windows 10

1 221

In this article, we will discuss “How to Setup Apache, PHP & MySql on Windows 10″.  When you are planning to install Apache, PHP & MySQL on Windows 10 machine, then We have two options to do this as given below:

  1. You can setup Xampp or Wamp server which enables all the feature as per our requirement.
  2. You can build your own fully functional Wamp server manually. In this, you have to install the Apache, MySql, and PHP manually.

I’m a Windows 10 user, so this tutorial is related to the Windows 10. Before starting the implementation, you need to read this article once.

Now, time to decide the versions we need to install. For this tutorial, I’m choosing the latest versions.

Setup Apache, PHP & MySql on Windows 10

Setup Apache

You can download the Apache server from the official site. Then extract the downloaded zip folder as per your desired location. Now follow the given instruction to install the Apache2.4 in windows 10.

Step 1: Open the command prompt as Administrator. And open the Apache root directory.

Setup Apache, PHP & MySql on Windows 10

Step 2: Time to update the “httpd.conf” config file located at “{Your directory path}/Apache24/conf”. Open the file and update the “SRVROOT”. I’m updating as per my directory setup.

Define SRVROOT "F:/localserver/Apache24"

Step 3: Setup the windows service. You can use the httpd -k install command to install the Apache2.4 service.Setup Apache, PHP & MySql on Windows 10

Step 4: After installing the service, you need to start the service. You can manage it from the windows service program. You need to open the “RUN” box using “Windows + R” key where you can type “services.msc” command to open the Service” program. Open the program and search Apache.

Setup Apache, PHP & MySql on Windows 10

After that click on the “start” then Apache service is started. You can stop or restart the service in the same place.

Setup Apache, PHP & MySql on Windows 10

Step 5: Time to test the Apache. Open the browser and hit the localhost in the URL.

Setup Apache, PHP & MySql on Windows 10


Setup PHP

Please download the latest PHP version from the official site. Then extract the downloaded zip folder as per your desired location. I recommend this to store PHP folder in the same location where you had setup the Apache Server. Now follow the given instruction to install the PHP and setup this with the Apache server.

Step 1: Rename php-ini-development.ini to php.ini.

Step 2: Add PHP in system environment variable using “setx path” command at command prompt.

C:\>setx path "%PATH%, F:\localserver\php-7.3.0" /M

Setup Apache, PHP & MySql on Windows 10

Step 3:  Update the “httpd.conf” config file once again. Open the file and append the following snippet.

// Update the PHP directory path as per your setup.
PHPIniDir "F:/localserver/PHP-7.3.0"
AddHandler application/x-httpd-php .php
LoadModule php7_module "F:/localserver/PHP-7.3.0/php7apache2_4.dll"

Step 4: Restart the “Apache2.4” service. After that create one testing PHP file under htdocs directory located at “{directory_path}/Apache24/”. Here I have created “phpinfo.php” page. At the end here the working PHP setup.

Setup Apache, PHP & MySql on Windows 10


Setup MySQL Server

You need to download the latest version of MySQL Server from the official site. I’m choosing an installer setup for my windows 10. After download completion, you need to follow the steps given below:

Step 1: Execute the installer, accept license agreement then click next.

MySql Server Setup Manually

Step 2: Select the setup type, I’m choosing a server only. You can choose “Developer Default”, this includes more tools like workbench, connectors and etc if required.

MySql Server Setup Manually

Step 3: In this step, we are checking requirements. Then click on the execute option.

MySql Server Setup Manually

Step 4: After completing the required setup. Popup is shown you need to click on the close button on a popup.

MySql Server Setup Manually

Step 5: After closing the popup, You have seen the green right tick on the requirement listed item. Just need to click on the next button.

MySql Server Setup Manually

Step 6: All is done now. Here you need to execute the setup.

MySql Server Setup Manually

Step 7: Again you have seen the green right tick symbol on the listed item. You need to click on the next button.

MySql Server Setup Manually

Step 8: Select the “Standalone MySQL Server” option. And click on the next button.

MySql Server Setup Manually

Step 9: Setup type and networking options. All details are predefined, you can change those as per your requirements.

MySql Server Setup Manually

Step 10: Select the authentication method, note that you need to use the legency authentication method. Because it will help you to setup this MySql Server with the phpmyadmin.

MySql Server Setup Manually

Step 11: Setup the root password.

MySql Server Setup Manually

Step 12: Here’s all the configuration step processed one by one. You need to click on the finish button when the process is done.

MySql Server Setup Manually

Step 13: Everythings done now, click the next button. And complete the final step.

MySql Server Setup Manually

MySQL server is ready now. You can manage MySQL service from the windows service program. You need to open the “RUN” box using “Windows + R” key where you can type “services.msc” command to open the Service” program. Open the program and search MySQL Service.

MySql Server Setup Manually


Setup phpMyAdmin

Our Apache and MySql setup are ready now. You need a client application to access the MySQL database such as MySQL Workbench, phpMyAdmin or etc. Now, we are going to setup the phpmyadmin with our MySql Server.

You can download the phpMyAdmin from the official site. Extract the downloaded zip file in “{directory_path}/Apache24/htdocs” and rename the folder to “phpmyadmin”.

After that, you need to update the “httpd.conf” located at “Apache24” directory. Open the file and update the ”dir_module”.

<IfModule dir_module>
    # Here you need to update index.html to index.php
    DirectoryIndex index.php
</IfModule>

Now, when you open a directory in the browser then the “index.php” file executes by default.

After that, you need to copy a file “config.sample.inc.php” located at “{directory_path}/Apache24/htdocs/phpmyadmin” and save this with a new name “config.inc.php” on the same location. Open the file and update the following code snippet.

/**
 * This is needed for cookie based authentication to encrypt password in
 * cookie. Needs to be 32 chars long.
 */
$cfg['blowfish_secret'] = 'n34uLaA3lvexVi6RaSG3T1BTna123m78'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

/* Authentication type */
$cfg['Servers'][$i]['user'] = 'root'; //mysql username here
$cfg['Servers'][$i]['password'] = 'password'; //mysql password here. here you need to add the password which you setup at the time of mysql server authentication setup.

Everything ready, Now time to check our phpmyadmin.

phpMyAdmin setup with MySql Server Manually

Conclusion

In this article, we are discussing the “Setup Apache, PHP & MySql on Windows 10”. We are creating this tutorial for knowledge. You can use Xampp or Wamp server, both of the servers provide rich features and flexibilities. Using these no need to install Apache, PHP, MySql or PHPMyAdmin manually. Please feel free to add the comment if any query or you can submit your feedback 🙂

Leave A Reply

Your email address will not be published.

1 Comment
  1. WILLIAMS says

    Thanks for sharing this wonderful tutorial. I will try to implement this soon 😉