Setup your own Apache MariaDB PHP phpMyAdmin on Windows!

Words
526
Reading
3 min
9y
Listen to this post
~4 min

Logos.png

In this topic I'm going to explain step by step how to make your own localhost
PHP - MariaDB - Apache - PhpMyAdmin
for development purposes without using any third party software Like XAMPP OR WAMP etc...

Why using bloated softwares like XAMPP or WAMP?
when you can build your own localhost your self without waiting for any updates or installing tools that you'r not using at all!

It gives you more flexibility over your localhost and more control.
also you don't have to wait for third party updates as you can make it your own self directly.

Recommended OS:

  • Windows 7
  • Windows 8.1
  • Windows 10

Also you wil need a text editor like Notepad++

Before we start you need to download

Apache LoungePHPphpMyadminMariaDB
v2.4.29v7.2.0v4.7.6v10.2
Download x64Download x64 (Thread Safe)DownoadDownload x64

Then make sure you've the following:

Visual C++ Redistributable for Visual Studio 2012
Visual C++ Redistributable for Visual Studio 2017

To avoid any errors like "MSVCR110.dll", "MSVCR140.dll"

Setup Apache

Extract your apache ZIP file to your hard drive and it will be like that:

C:\Apache24

Now you wil need to edit:
C:\Apache24\conf\httpd.conf

Use CTRL + F to search for:

#ServerName www.example.com:80

Uncomment it and change it your system's host name for example
ServerName localhost

Then save it.

Open Command Prompt as an Administrator
Type:

cd C:\Apache24\bin
Enter

Then Type:

httpd.exe -k install

Enter

if the result like the following:

Installing the 'Apache2.4' service
The 'Apache2.4' service is successfully installed.
Testing httpd.conf....
Errors reported here must be corrected before the service can be started.

then everything is fine

Now Start Apache Service:

httpd.exe -k start

Now you've finished.

Open a browser and browse to:
http://localhost

If the page saysIt works!

That means Apache has been successfully installed.

To stop apache service open command prompt again then type:

httpd.exe -k stop

Also you can use ApacheMonitor
Sketch.png

Located in:

C:\Apache24\bin

Also you can check the service by Windows + R

Then type:

services.msc

Search for Service Named "Apache2.4" That's it

Setup MariaDB

open "mariadb-10.2.11-winx64.msi" that you've downloaded

1.png

Follow the steps in the installer

Next > Accept Terms > Next

Now I Think you don't need third party tool called HeidiSQL
left click on third party tools and select entire feature will be unavailable

Next

Set a password for root
Sketch.png

Hit Next > Default instance properties (should be fine) > Next > Next > Install

MariaDB installed successfully.

Setup PHP 7

Extract "php-7.2.0-Win32-VC15-x64" to a New Folder called PHP for example
C:\PHP

Rename
php.ini-development

Sketch.png

to

php.ini

Open php.ini with your text editor then search for:

; extension_dir = "ext"

change it to your php path for example:
extension_dir = "C:\PHP\ext"

now we have to enable some extenstions like:
mbstring
mysqli
pdo_mysql

you can start doing that by uncomment lines in php.ini
for example search for:

;extension=mbstring

then remove;and so on for the rest.

Now we've to configure Apache to use PHP 7

Add the following lines toC:\Apache24\conf\httpd.conf
after all the LoadModule lines


LoadModule php7_module C:/PHP/php7apache2_4.dll

<IfModule php7_module>
    DirectoryIndex index.html default.php index.php
    AddHandler application/x-httpd-php .php
    PHPIniDir "C:/PHP"
</IfModule>

Go to:
C:\Apache24\bin

Now Restart Apache Service by command prompt or use ApacheMonitor:

httpd.exe -k restart

Now go to:
C:\Apache24\htdocs

Create info.php file:

<?php
phpinfo();
?>

Then Save it.

Check your php info for example:

http://localhost/info.php

phpMyAdmin

Extract phpMyAdmin-4.7.6-all-languages.zip to:
C:\Apache24\htdocs

Rename:

phpMyAdmin-4.7.6-all-languages

To:

phpMyAdmin

Then move it to:

http://localhost/phpMyAdmin

Sketch.png

Login with your root username and your root password for MariaDB
usually username is:
root

Congratulation now you've your own localhost and its ready for use!

References:
Function PHP Info
The Lastest Visual C++ Downloads
Apache Windows Document
phpMyAdmin FAQ



Posted on Utopian.io - Rewarding Open Source Contributors

Setup your own Apache MariaDB PHP phpMyAdmin on Windows! | Ecency