Wednesday, August 17, 2022

How to install apache, php, mysql and phpmyadmin on windows 10

Apache server

1. download apache from official website - https://www.apachelounge.com/download/
2. extract folder to d:\webserver\apache2.4
3. edit file d:\webserver\apache2.4\conf\httpd.conf
Define SRVROOT "d:\webserver\apache2.4"
4. open cmd go to d:\webserver\apache2.4\bin and run httpd -k install
5. type services.msc and run application apache2.4

PHP module
1. download php from official website - https://windows.php.net/qa/
2. extract folder to d:\webserver\php-8.2.0
3. add php in system environment setx path "%PATH%, d:\webserver\php" /M
4. edit file d:\webserver\apache2.4\conf\httpd.conf
PHPIniDir "d:/webserver/php-8.2.0"
AddHandler application/x-httpd-php .php
LoadModule php_module "d:/webserver/php-8.2.0/php8apache2_4.dll"
<IfModule dir_module>
    DirectoryIndex index.php
</IfModule>

4. Rename php-ini-development.ini to php.ini.
5. create file in d:\webserver\apache2.4\htdocs\i.php

6. open browser to test http:\\localhost\i.php

Mysql server
1. download "mysql installer for windows" from official website - https://dev.mysql.com/downloads/mysql/
2. select setup type server only
3. select legacy authentication method
4. create user and password
5. run mysql through services.msc

PHPMyAdmin
1. download phpmyadmin from official website - https://www.phpmyadmin.net/downloads/
2. extract file to d:\webserver\apache2.4\htdocs\phpmyadmin
3. copy file d:\webserver\apache2.4\htdocs\phpmyadmin\config.sample.inc.php to config.inc.php
4. edit file d:\webserver\apache2.4\htdocs\phpmyadmin\config.inc.php
$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
5. edit file d:\webserver\php-8.2.0\php.ini
include_path = ".;D:\webserver\php-8.2.0\includes"
extension_dir = "d:\webserver\php-8.2.0\ext"
extension=php_mysqli.dll
extension=php_mbstring.dll
extension=php_pdo_mysql.dll
6. open browser to test http:\\localhost\phpmyadmin\