How to install and configure Apache 2.x, PHP and MySQL on Windows 10 & 11

Nonni World
0

In this article, we will discuss "How to Set Up Apache, PHP & MySQL on Windows 10." 

When planning to install these on a Windows 10 machine, you have two options:

  1. Set up XAMPP or WAMP Server: These packages enable all the features you need and are easy to set up.
  1. Build Your Own Server Manually: In this method, you install Apache, MySQL, and PHP manually.


Install / Configure Apache, PHP & MySQL 

Setup Apache

You can download the Apache2.4 server from the official website. Then extract the downloaded zip folder to your desired location. 

Step1: 

Open the command prompt as Administrator and open the Apache root directory where you extracted.


Step2:

We need to define the SVRROOT path, in that case we need to open the "httpd.conf" config file which is located at {"your extracted directory path/Apache24/cong"}. open the file and update the "SRVROOT".


Step3:

Now we will install the Apache2.4 as windows service. You can do that using the httpd -k install from the command prompt.



Step4:

Once you install the httpd as windows service, you need to open the windows services program. You can open by typing services.msc in the Run box.


Select the Apache24 and click Start or right click on the Apache and select start. Make sure status should be shows as Running.


Step5:

Once the Apache services status shows Running, The web server is ready to run. 

You need to open any browser and type localhost in the address bar, it should shows It works!.


Setup PHP

To install the PHP, you need to download the latest PHP version from the official website. Extract the downloaded zip file to you desired location, recommended it should extracted under  the php folder under the Apache server you have installed. 

Step1:

Rename php.ini-development to php.ini

Step2:

Add PHP path in the system environment variable using "setx path" command at command prompt.

C:\setx path "%PATH%, F:\localerver\php-8.2.3" /M

Step3:

Now we need to edit the httpd.conf config file, you can find this file in the {"your extracted directory path/Apache24/cong"}. Open the file and add the following lines at the end of the file. 

// Update the PHP directory path

PHPIniDir "F:/localserver/PHP-8.2.3"

AddHandler application/x-httpd-php .php

LoadModule php_module "F:/localserver/PHP-8.2.3/php8apache2_4.dll"


Step4:

Restart the Apache2.4 services by following the same step4 from Apache Setup. 

Once Apache restarted You can test the php by creating the php file with the below line of code and save the file as phpinfo.php under the "{directory_path}/Apache24/htdocs". and run from the web-browser.




Setup MySQL

You can download the latest version of MySQL server from the official website.

Once download please follow the steps below:

Step1:

Run the installer and accept the license agreement and hit next.



Step2:

You need select the type, recommended to select server only, but you can select Developer Default if you need extra features line workbench, connectors and etc.

 


Step3:

The installer will check the required decencies, and offer to install if it not installed already.

 


Step4:

Once all the dependences are installed the installer is ready to execute the selected components. 



Step5:

Once it's completed to download the installer is ready to configure the server, click Next to bring the server configuration screen and select the standalone MySQL Server option.



Step6:

In the next screen the installer will bring setup type and networking options. All the recommended values are predefined you can press next or you can change the values as per your requirements. 



Step7:

We need to select the authentication method, we have two option as below:

- Use strong Password Encryption 

- Use Legacy Authentication method. 

Recommended Authentication method is Legacy Method as this will work flawlessly with the phpMyAdmin. 


Step8:

In this screen we need to set the root password. 


Step9:

We pass through all the steps to configure the MySQL Server now installer is ready to configure and Finish button will be active once done.


Step10:

To confirm the MySQL is installed and running, open the services and make sure MySQL80 service is up and running.


Setup phpMyAdmin:

To access the MySQL database we need the client application to access the database, Application like Workbench, Dbviewer, phpMyAdmin etc.

You can download phpMyAdmin from the official website. Once downloaded extract to the zip file in "(directory_path}/Apache24/htdocs" and rename the folder to phpmyadmin. 

Now we need to update the "http.conf" located at "Apache24" directory open the file and  update the "dir_module".


At this point, we need to open the directory in the browser and open index.php will run by default.

This will create the "config.sample.inc.php" file you can find this file under "{directory_path}/Apache24/htdocs/phpmyadmin". Copy this file and paste in the same location and rename it to "config.inc.php". 

Open the config.inc.php file and update the below code snippet. 



All done. we can access the phpmyadmin from the web browser. 



I hope this article help you install and configure the Apache, Php and Mysql along with phpMyAdmin.

 



 







 








 

Post a Comment

0 Comments
Post a Comment (0)

#buttons=(Ok, Go it!) #days=(20)

Our website uses cookies to enhance your experience. Learn More
Ok, Go it!
To Top