Installation drupal 8.4.2 on Windows 10-step by step

Here is a long blow by tortuous blow of installing drupal8.4.2 on Windows 10 using

Apache2.4

MariaDB 10.2.9

PHP 7

phpMyAdmin 4.7.5

Drupal 8.4.2

I installed it as a test site only and it was never intended to go live, however with some modification for security it could. It probably belongs as part of the installation documentation.

Getting started
Log on as Administator. This just saves having to enter the administrator password lots of times.
Note:
The user “Administrator” (or Admin or Administrators) is just another user with “higher” level rights. Unlike Unix it is NOT the supreme user account where anything can be done.
There is another “higher” level account called “Trusted Installer” which has some higher level permissions. In this way the “Windows Upgrade” is able (and does) override administrator and user rights AND configuration.
It will update and reinstall applications even though you have specifically deleted them or uninstalled them. Big brother (Microsoft) knows best!

A note here is appropriate about file permissions:
Windows seems to “jealously” guards its system files and the way the windows interacts with windows applications.
If you install non windows applications in Windows folders it may apply permissions and file attributes to those files.
Changing the file permissions may well get things working but there is no guarantee that the permissions will stay that way.
When Microsoft updates windows it may well change the installed components and what it considers external programs in the system directories.
Non windows applications are considered any application that does not conform to the Microsoft version of what Microsoft says a windows application is.
In Windows world each user has its own folder for user and application information.
This makes file placement and configuration a whole lot harder. It also means you SHOULD NOT attempt to change these files independently unless you really know what you are doing.
It explains why some programs may work for some users but not for others when changes are made in ways that Windows does not know about.
In this way users can be restricted to certain applications, data, and files. Data & applications are kept private from other users.
A windows application installed by an administrator is usually accessible to all users but cannot be itself modified by any user except the administrator.
By the same token a windows application can be installed by a single user but that single user needs administrator permission to install it.
The application is available to the user only (and the administrator) but the installing user needs administrator permission to modify the installation.
Files in the Users, Windows, Program Files, Program Files (x86) and ProgramData directories & subdirectories may be treated this way and usually have ownership attributes set to users, administrators, everybody
as well as System, Special, Installer or Trusted installer or combinations of same.
On systems with multiple users it is a most prudent method to ensure privacy. It also becomes a standard for application programmers.
To further complicate things each application has both ownership and user rights to files it creates and inheritance from upper directories.

Files you place in the root directory will usually have ownership attributes of Everybody.
You will also note the directories Program Files & Program Files (x86) have spaces in the directory names and some will have spaces in the file name itself.
That is quite often problematic to programs written for other operating systems like Unix.
Also windows file & directory names are not case sensitive unlike Unix

There is no guarantee that files in the system directories will not have ownership permission changed with an upgrade to windows.
Antivirus programs suddenly found they were excluded in Europe after one major upgrade simply because the upgrade was released without reference to these application developers
who were suddenly required to verify their programs were compatible with the upgrade.
This was seen as a Microsoft attempt to monopolize the antivirus market with their inbuilt offering. Legal action was commenced and Microsoft were forced to back down and came to arrangements with the various manufacturers.

Not necessary but makes things a lot easier, download & install Notepad++ (https://notepad-plus-plus.org/repository/7.x/7.5.1/npp.7.5.1.Installer.exe)

Open “Command Prompt” (Windows Application – Windows System -Command Prompt) This opens a command prompt window.
Right click on its icon on the taskbar and select “Pin to Taskbar”
Close the command prompt window.

You will notice in the following files to download the text “VC14” or “VC15”
This refers to Visual C version 14 or Visual C version 15 which are usually part of the Visual Studio Windows Application Suite.
This says what compiler version these programs were compiled with and more importantly which Windows RUNTIME dependencies library they need.
Unfortunately, Microsoft in its wisdom may not make each later version backwards compatible.
You cannot install a version 14 Runtime library once you have the version 15 Runtime library.

What I have done is download them and install them ALL one after another starting at
Microsoft Visual C++
2005 Redistributable (32 bit then 64 bit)there are also updates to these files as well!
2008 Redistributable (32 bit then 64 bit)there are also updates to these files as well!
2010 Redistributable (32 bit then 64 bit)
2012 Redistributable (32 bit then 64 bit)
2013 Redistributable (32 bit then 64 bit)
2015 Redistributable (32 bit then 64 bit)
2017 Redistributable (32 bit then 64 bit)
Unfortunately, Microsoft names them all the same in their download files so it is necessary to download and install individually in sequence from oldest to newest
Almost certainly you will probably not use the older files, I have them downloaded for some older applications.
Hunt through the Microsoft site as the locations not only change but they are usually dynamic links that change from time to time

Download the following files
(for 64 bit systems. For 32 bit systems change the downloads to x86 or win32 as needed. READ the information on the download sites!)
DONOT mix the 32 (x86) and the 64bit of Apache & PHP. Use the thread safe version of php

Apache2.4 ( http://www.apachelounge.com/download/VC15/binaries/httpd-2.4.29-Win64-VC… )
PHP 7.1 ( http://windows.php.net/downloads/releases/php-7.1.11-Win32-VC14-x86.zip )
MariaDB ( https://downloads.mariadb.org/interstitial/mariadb-10.2.10/winx64-packag… )
Opcache staus master (https://github.com/rlerdorf/opcache-status/archive/master.zip)
phpMyAdmin-4.7.5-all-languages ( https://files.phpmyadmin.net/phpMyAdmin/4.7.5/phpMyAdmin-4.7.5-all-langu… )
Drupal8.4.2 ( https://ftp.drupal.org/files/projects/drupal-8.4.2.zip )

Extract the Apache2.4 files. My files were all downloaded to the Windows folder called “Download” When I extract the files they extract to this folder.
Move (or copy & paste) the Apache24 folder to C:

Edit the file httpd.conf (C:/Apache24/bin)
Find the line “#ServerName www.example.com:80”  type on the next line
ServerName LocalHost:80

Save the file

Right Click on the Command Prompt on the Taskbar then RIGHT click on the Command Prompt and select “Run as Administrator”. Press yes to the popup window
In the Command Prompt window type in the following
cd /Apache24/bin (return)
Type httpd -k install (return)
There should be no more lines below
“Errors reported here must be corrected before the service can be started”

If there are errors read the information in the HTTPd.conf and try to work out what is wrong or go to the apache lounge website and search the forums for the fix.

Type httpd -k start (return)

Now open your web browser and type “Localhost”
You should get  a message “It works!”

Congratulations you have installed the apache web server!

Use “Windows Explorer” to navigate to the “c:/apache24/bin” folder and click on “ApacheMonitor.exe”
This application allows an easy way to start and stop the Apache Service. It puts an icon on the Taskbar (may be hidden, so just make it visible)

We have a basic web server but all it will do is display HTML files (it works is actually a file called index.html)

Install MariaDB by clicking on mariadb-10.2.10-winx64.msi BUT DO NOT Install to the Progam Files (x86) directory but to a C:/mysql
The reason to do it this way is it avoids future problems because the directory Program Files (x86) has a space in it.
Write down the root password you used in the installation.

In your Download folder Click on php-7.1.11-Win32-VC14-x64.zip
extract it to the root directory in a directory “PHP” (usually “C:PHP”)

Read and understand the httpd.conf file (C:/Apache24/conf/httpd.conf)

Modify the HTTPD.cfg as follows
(to uncomment a line remove the leading # or just add the text)

LoadModule rewrite_module modules/mod_rewrite.so

Add the following:

LoadModule php7_module “c:/php/php7apache2_4.dll”
AddHandler application/x-httpd-php .php
AddType application/x-httpd-php .php .html .htm
PHPiniDir “C:/php”

Find “DirectoryIndex index.html” and change it to
DirectoryIndex index.html index.php
This tells appache to first look for an inex.html file to load and if it is not present then load index.php and if not then make a list of the files & Directories
Find this section
 # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be “All”, “None”, or any combination of the keywords:
    #   AllowOverride FileInfo AuthConfig Limit
    #
    AllowOverride none
and change it to
    AllowOverride all

Save the file.

Using File Explorer

Copy and paste the file PHP.ini-production (C:/php)
Windows will paste it as PHP-Copy.ini-production. Rename this file to the php.ini
Modify the php.ini as follows

max_execution_time = 90 (was 30)  
max_input_time = 90 (was 60)
I changed these 2 lines because my computer is fairly old and a bit slow. You can leave their defaults and try to install drupal8, but it may run out of time executing some of the scripts.

Where a line is present in php.ini with a “;” infront of it to make it active remove the ;

Remove the “;” from the start of the following lines
include_path = “.;c:phpincludes”
(Not sure if this is actually needed but it may be down the track. )
extension_dir = “ext”
extension=php_bz2.dll
extension=php_curl.dll
extension=php_gd2.dll
extension=php_mbstring.dll
extension=php_exif.dll       ; Must be after mbstring as it depends on it
extension=php_mysqli.dll
extension=php_openssl.dll
extension=php_pdo_mysql.dll
opcache.enable=1

Add the following line
zend_extension = “c:phpextphp_opcache.dll”
Save the php.ini file

Create a text file and save it in the C:/apache24/htdocs directory (just use notepad if you dont have Notepad++) as info.php
Edit this file and add
<?php
phpinfo();
?>
Save

In the Downloads folder click on  opcache_staus_master.zip
Extract opcache.php to C:/apache24/htdocs (I just extracted the one file not the rest)

Using File Explorer navigate to C:/Apache24/Htdocs
Rename the file inex.html to ItWorks.html

Right Click on the Command Prompt on the Taskbar then RIGHT click on the Command Prompt and select “Run as Administrator”. Press yes to the popup window
In the Command Prompt window type in the following
cd /Apache24/bin (return)
Type httpd -k stop (return)
Type httpd -k uninstall (return)
Type httpd -k install (return)
There should be no more lines below
“Errors reported here must be corrected before the service can be started”

There may be errors. They will be listed.
One common error is c:/php/php7apache2_4.dll is not a windows application.
This may be caused by either the failure to download the Runtime librarys or installing a mixed set of Apache2.4/php, for example a 64 bit version of one and a 32 bit version (x86) of the other.
You must fix this before preceding!
Read the httpd.conf & php.ini to try and work out what is happening and correct it.

When there are no errors open your webbrowser to Localhost
You will see three items in a list
ItWorks.html
info.php
opcache.php
By default the apache webserver looks for a file called index.html, then index.php and if they are not found it list all the files and directories in the ServerDocs folder (C:/apache24/htdocs)

Click on each one in turn
You should get
“ItWorks”
Extensive information about your php program and the extensions loaded
A page entittled “PHP 7.1.11 with OpCache 7.1.11”

If you do not review the changes to php.ini, restart the webserver (use ApacheMonitor) and try again.

Extract phpMyAdmin-4.7.5-all-languages.zip to C:/apache24/htdocs.

Using File Explorer copy and paste config.sample.inc.php from/to c:/apache24/htdocs/phpMyAdmin-4.7.5-all-languages directory
Rename the new copy to config.inc.php
Edit this file and follow the instructions about ‘blowfish_secret’. This is a 32 characters long. This is the key to encrypt your cookies.
Change
$cfg[‘Servers’][$i][‘AllowNoPassword’] = False; to
$cfg[‘Servers’][$i][‘AllowNoPassword’] = true;
Save the file

Now when you got to localhost in your browser you will have an 4 entries in the list
ItWorks.html
info.php
opcache.php
phpMyAdmin-4.7.5-all-languages

Click on “phpMyAdmin-4.7.5-all-languages”
Type “root” and the Mariadb password
You will get a warning “The phpMyAdmin configuration storage is not configured……”
Select “User Accounts” then “Create New”
User Name type “pma”
Password select ‘No Password’
Global Priveleges click on “Select all”
Press “Go”
Exit by typing Localhost in the browser
Click on “phpMyAdmin-4.7.5-all-languages”
Fill in the logon & password (if needed)
You will still get a warning “The phpMyAdmin configuration storage is not configured……”
click on the “Find out Why” and click the green “create”
This will create the phpMyAdmin database and fill in its tables
All done.

Click on the downloaded file “drupal-8.4.2.zip” Extract the Drupal8 files to c:/apache24/htdocs
Use File Explorer to go to “c:/apache24/htdocs” and rename the drupal-8.4.2 directory to “drupal”
The reason is to make it much neater to type localhost/drupal rather than localhost/drupal-8.4.2/ when the installation is complete
Open a browser to Localhost
The list now looks like this:

ItWorks.html
drupal
info.php
opcache.php
phpMyAdmin-4.7.5-all-languages

Click on “Drupal”
The installer page will start
Select the language
Click “Save and Continue”
Select “Standard” on the Installation Profile Page
Click “Save and Continue”

You may get a warning “Clean URLs”
You need to fix this. Follow the links to figure out what is happening
if you have to fix this just go back to Localhost and restart the installation of Drupal.
Once past this point, fill in the Database Configuration page
Choose a Database name. All the information on your Drupal Installation site will be stored here
I suggest “Drupal842”
Database Username “root”. This is the username of the mariaDB Sql server that has permission to create both users & databases
Password “whatever you set the root password when you installed MariaDB”
Click “Save and Continue”

Site Name “Drupal842 test site” Whatever you want
email address: “This is an email address admin emails will be sent to”

Site Maintainence Account “drupaladmin” this is the logon account to alter configuration etc choose any name you like
Password “whatever you choose-just remember to write it down”

Select the rest like location and time difference or leave them to fill in later

You should end up with the drupal8 Welcome screen. You are now done!

Click on the “Configuration” menu. You may have errors. Click on the status report link and take notice of what it says and fix it!

If you wish to restart the installation of drupal, use file explorer and navigate to the “c:/apache24/htdocs/drupal/sites/defaults”
Delete the file settings.php
Use phpMyAdmin-4.7.5-all-languages in your browser to delete the database “drupal842” (or whatever you named the database)
Now just click on the Localhost/drupal in your browser and the installation will repeat.

I have NOT configured emails from the server as yet. You will need to go through the Httpd.conf and change some of the settings to make it all happen.

Drupal version: 


Source: https://www.drupal.org/taxonomy/term/1/feed