Skip to content

Instantly share code, notes, and snippets.

@cham11ng
Last active February 11, 2018 08:32
Show Gist options
  • Save cham11ng/592054ac4cd01da520ffccc71f04c51a to your computer and use it in GitHub Desktop.
Save cham11ng/592054ac4cd01da520ffccc71f04c51a to your computer and use it in GitHub Desktop.
Installing WAMP Apache2.4, MariaDB and PHP7.1 in Windows

Installing WAMP Apache2.4, MariaDB and PHP7.1 in Windows

Step 1 - Download

Download Apache2.4

We are going to use the unofficial Windows binary from Apache Lounge. This version has performance and stability improvements over the official Apache distribution, although I am yet to notice a significant difference. However, it is provided as a manually installable ZIP file from Download Apache2.4

Download PHP7.1

Download PHP7.1 Extract the PHP binary archive using your unzip utility; C:\php7 is a common location. Copy php.ini-development or php.ini-production to php.ini

Download MariaDB

Download MariaDB 10.1

Download Visual C++ Redistributable (if required)

If Some Error with

  1. api-ms-win-crt-runtime-l1-1-0.dll missing
  2. vcruntime140.dll missing To fix this error you need Visual C++ Redistributable for Visual Studio 2015. Download Visual C++ Redistributable

Step 2 - Extract

We will install Apache in C:Apache2, so extract the ZIP file to the root of the C: drive. Extract PHP7.1 to root C: drive

Step 3 - Installing Apache as a Service

rem # Or whatever path you unzipped the Apache files
cd "C:\Apache24\bin"

You can install Apache as a Windows NT service as follows from the command prompt at the Apache bin subdirectory:

rem #Command to install Apache 2.4 as a Windows Service
httpd.exe -k install

If you use the first command without any special parameters except -k install, the service will be called Apache2.4 and the configuration will be assumed to be conf\httpd.conf.

If you need to specify the name of the service you want to install, use the following command. You have to do this if you have several different service installations of Apache on your computer. If you specify a name during the install, you have to also specify it during any other -k operation.

httpd.exe -k install -n "Apache 2.4"

If you need to have specifically named configuration files for different services, you must use this:

httpd.exe -k install -n "Apache 2.4" -f "c:\files\my.conf"

Removing an Apache service is easy. Just use:

httpd.exe -k uninstall

The specific Apache service to be uninstalled can be specified by using:

httpd.exe -k uninstall -n "Apache 2.4"

Step 4 - Start Apache

Add this line in Apache24\config\httpd.conf at TOP

LoadModule php7_module C:/php7/php7apache2_4.dll

<IfModule php7_module>
    DirectoryIndex index.html index.php
    AddHandler application/x-httpd-php .php
    PHPIniDir "c:/php7"
</IfModule>
rem #Command to start the Apache Windows service
net start "Apache 2.4"

Step 4 - Hit localhost in Browser

Modify Apache24\htdocs\index.php

<?php
    echo phpinfo();
?>

Go to your browser and hit http://localhost or http://127.0.0.1

Step 4 and 1/2 - For Custom Location

Modify All c:\Apache24 to Drive:\Any\ in httpd.conf which includes change your ServerRoot, DocumentRoot, cgi-bin, htdocs Also PHP7 Location Reference Apache2.4 Configuration

Step 5 - Installing Maria DB

Install Maria DB

References

With Pictures

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment