How to install web server on Windows 10 (Apache 2.4, PHP 8, MySQL 8.0 and phpMyAdmin)

1. Downloading Apache, PHP, MySQL, phpMyAdmin

Now we have files:

  • httpd-2.4.29-Win64-VC15.zip
  • php-7.2.0-Win32-VC15-x64.zip
  • mysql-8.0.11-winx64.zip
  • phpMyAdmin-4.7.7-all-languages.zip
  • vc_redist.x64.exe

Run and install the vc_redist.x64.exe file, we will not return to it.

2. Create necessary folders

On the drive C create a directory Server; inside it create the bin directory (we will install Apache, PHP, and MySQL there) and data directory (our websites and databases will be located there).

We continue our preparations. In the data directory create two folders:

  • DB (database will be stored here)
  • htdocs (websites will be stored here)

Tree of the important folders that are mentioned in this manual:

C:.
└── Server
    ├── bin
    │   ├── Apache24
    │   │   └─── conf
    │   ├── mysql-8.0
    │   ├── PHP
    │   └── Sendmail
    ├── certs
    ├── data
    │   ├── DB
    │   │   └─── data
    │   └── htdocs
    │       └─── phpmyadmin
    └── manage

3. Installation and configuration Apache 2.4 on Windows

Unpack the Apache files (archive httpd-2.4.25-win64-VC14.zip) to the C:\Server\bin\ directory (we are interested only in the Apache24 folder):

After unpacking, go to the c:\Server\bin\Apache24\conf\ folder and open the httpd.conf file with any text editor.

Replace

Define SRVROOT "c:/Apache24"

with

Define SRVROOT "c:/Server/bin/Apache24"

replace

#ServerName www.example.com:80

with

ServerName localhost

replace

DocumentRoot "${SRVROOT}/htdocs"

with

DocumentRoot "c:/Server/data/htdocs/"

replace

<Directory "${SRVROOT}/htdocs">

with

<Directory "c:/Server/data/htdocs/">

replace

DirectoryIndex index.html

with

DirectoryIndex index.php index.html index.htm

replace 

    # 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

with

    # 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 All

and replace

#LoadModule rewrite_module modules/mod_rewrite.so

with

LoadModule rewrite_module modules/mod_rewrite.so

Save and close the file. Apache configuration is complete!

Open a command prompt (it can be done by simultaneously pressing Win + X). Select ‘Windows PowerShell (admin)’:

Copy-paste:

c:\Server\bin\Apache24\bin\httpd.exe -k install

and press Enter.

If you see Firewall prompt, select ‘Allow access’.

Also copy-paste and run:

c:\Server\bin\Apache24\bin\httpd.exe -k start

Afterwards in your bowser follow the link http://localhost/ you’ll see something like that

It means:

  • Apache works
  • directory c:\Server\data\htdocs\ is empty

You can play with your new shiny web-server: add html-files to the folder, your server is running.

4. Installation and configuration MySQL 8.0 on Windows

In the c:\Server\bin\ folder unpack MySQL archive (the mysql-8.0.11-winx64.zip file). Rename it to mysql-8.0 (just for short).

Go inside the mysql-8.0 folder and create my.ini file. Open this file with any text editor. Copy-paste the following lines:

[mysqld]
 
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 
datadir="c:/Server/data/DB/data/"
default_authentication_plugin=mysql_native_password

Save and close it.

Configuration is completed! But we have to initialize and install MySQL 8.0 on Windows. Open Command Prompt (as Admin) and run:

C:\Server\bin\mysql-8.0\bin\mysqld --initialize-insecure --user=root
C:\Server\bin\mysql-8.0\bin\mysqld --install
net start mysql

Once the process completed, inside the C:\Server\data\DB\data\ folder automatically generated files should appear:

From now MySQL service will start automatically with every Windows boot.

If initialization failed and there is lack of files in the C:\Server\data\DB\data\ folder and MySQL service failed to start, or in the C:\Server\data\DB\data\*.err file you got errors like that:

[ERROR] InnoDB: Operating system error number 87 in a file operation
[ERROR] InnoDB: File .\ib_logfile101: 'aio write' return OS error 187.
[ERROR] InnoDB: Cannot continue operation

To cope the issue, remove all files from C:\Server\data\DB\data\ folder, and to the my.ini file add the line:

innodb_flush_method=normal

After that initialize MySQL again:

C:\Server\bin\mysql-8.0\bin\mysqld --initialize-insecure --user=root
C:\Server\bin\mysql-8.0\bin\mysqld --install
net start mysql

Everyone who has issues with MySQL service, to fix it try to reset MySQL installatoin and install in from scratch:

1. Remove the service:

net stop mysql
c:\Server\bin\mysql-8.0\bin\mysqld --remove

2. In the c:/Server/data/DB/data/ folder remove all files

3. Initialize and install the service:

C:\Server\bin\mysql-8.0\bin\mysqld --initialize-insecure --user=root
C:\Server\bin\mysql-8.0\bin\mysqld --install
net start mysql

If the problem persists please provide the content of the C:\Server\data\DB\data\*.err file.


5. Installation PHP 8 on Windows

In the c:\Server\bin\ create new PHP folder and copy there the contents of php-7.1.1RC1-Win32-VC14-x64.zip.

Again open the c:\Server\bin\Apache24\conf\httpd.conf file and append it with lines:

PHPIniDir "C:/Server/bin/PHP"
AddHandler application/x-httpd-php .php
LoadModule php_module "C:/Server/bin/php/php8apache2_4.dll"

And restart Apache:

c:\Server\bin\Apache24\bin\httpd.exe -k restart

In the c:\Server\data\htdocs\ folder create i.php file and copy to there:

<?php
phpinfo ();

In a browser open the http://localhost/i.php address. If you see something like this, it means PHP works:

6. Configuration PHP 8

In the c:\Server\bin\PHP\ folder rename php.ini-development file to php.ini. Open it with a text editor. Find the string

; extension_dir = "ext"

and replace it with

extension_dir = "C:\Server\bin\PHP\ext\"

Now find the group of strings:

;extension=bz2
;extension=curl
;extension=ffi
;extension=ftp
;extension=fileinfo
;extension=gd
;extension=gettext
;extension=gmp
;extension=intl
;extension=imap
;extension=ldap
;extension=mbstring
;extension=exif      ; Must be after mbstring as it depends on it
;extension=mysqli
;extension=oci8_12c  ; Use with Oracle Database 12c Instant Client
;extension=odbc
;extension=openssl
;extension=pdo_firebird
;extension=pdo_mysql
;extension=pdo_oci
;extension=pdo_odbc
;extension=pdo_pgsql
;extension=pdo_sqlite
;extension=pgsql
;extension=shmop

and replace it with

extension=bz2
extension=curl
extension=ffi
extension=ftp
extension=fileinfo
extension=gd
extension=gettext
extension=gmp
extension=intl
extension=imap
extension=ldap
extension=mbstring
extension=exif      ; Must be after mbstring as it depends on it
extension=mysqli
;extension=oci8_12c  ; Use with Oracle Database 12c Instant Client
extension=odbc
extension=openssl
;extension=pdo_firebird
extension=pdo_mysql
;extension=pdo_oci
extension=pdo_odbc
extension=pdo_pgsql
extension=pdo_sqlite
extension=pgsql
extension=shmop

Now uncomment this group of strings:

;extension=soap
;extension=sockets
;extension=sodium
;extension=sqlite3
;extension=tidy
;extension=xsl

They should look like:

extension=soap
extension=sockets
extension=sodium
extension=sqlite3
extension=tidy
extension=xsl

Save the file and restart Apache.

7. Installation and configuration phpMyAdmin on Windows

To the c:\Server\data\htdocs\ folder copy the content of phpMyAdmin-4.6.5.2-all-languages.zip. Rename phpMyAdmin-4.6.5.2-all-languages to phpmyadmin (for brevity).

In the c:\Server\data\htdocs\phpmyadmin\ folder create config.inc.php file and copy there:

<?php
 
/* Servers configuration */
$i = 0;
 
/* Server: localhost [1] */
$i++;
$cfg['Servers'][$i]['verbose'] = '';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['port'] = '';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['nopassword'] = true;
$cfg['Servers'][$i]['AllowNoPassword'] = true;
 
/* End of servers configuration */
 
$cfg['blowfish_secret'] = 'kjLGJ8g;Hj3mlHy+Gd~FE3mN{gIATs^1lX+T=KVYv{ubK*U0V';
$cfg['DefaultLang'] = 'en';
$cfg['ServerDefault'] = 1;
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';
 
?>

Open in your browser http://localhost/phpmyadmin/

Enter root as name, do not fill password. If everything is fine it should look like that:

8. Usage and backup web-server

In the c:\Server\data\htdocs\ folder put your local web sites, create HTML, PHP and another files. For instance, I created c:\Server\data\htdocs\test\ajax.php file, so this file will be available at the address http://localhost/test/ajax.php and so on.

To create full backup including all web sites and databases, just copy data folder in a save place. If you will need restore your information, with backup you can do it easily.

Before updating web-server modules, backup bin folder, if you will have issues you can fallback to previous versions.

Make backup of the following files, with them you can deploy new instance of the server faster.

  • c:\Server\bin\Apache24\conf\httpd.conf
  • c:\Server\bin\mysql-8.0\my.ini
  • c:\Server\bin\PHP\php.ini
  • c:\Server\data\htdocs\phpmyadmin\config.inc.php

These files keep all settings and when we are installing new web server instance most of the time we are engaged in their editing

9. Extra PHP configuration

Some PHP settings you should know:

; Maximum execution time of each script, in seconds
; http://php.net/max-execution-time
; Note: This directive is hardcoded to 0 for the CLI SAPI
max_execution_time = 30

; Maximum amount of time each script may spend parsing request data. It's a good
; idea to limit this time on productions servers in order to eliminate unexpectedly
; long running scripts.
; Note: This directive is hardcoded to -1 for the CLI SAPI
; Default Value: -1 (Unlimited)
; Development Value: 60 (60 seconds)
; Production Value: 60 (60 seconds)
; http://php.net/max-input-time
max_input_time = 60

; Maximum input variable nesting level
; http://php.net/max-input-nesting-level
;max_input_nesting_level = 64

; How many GET/POST/COOKIE input variables may be accepted
; max_input_vars = 1000

; Maximum amount of memory a script may consume (128MB)
; http://php.net/memory-limit
memory_limit = 128M 

; Maximum size of POST data that PHP will accept.
; Its value may be 0 to disable the limit. It is ignored if POST data reading
; is disabled through enable_post_data_reading.
; http://php.net/post-max-size
post_max_size = 8M    

; PHP's default character set is set to UTF-8.
; http://php.net/default-charset
default_charset = "UTF-8"   

; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 2M

; Maximum number of files that can be uploaded via a single request
max_file_uploads = 20

It is not necessary to do something with them, but if you are rested into the limits, they will be useful

10. Extra phpMyAdmin configuration

If in phpMyAdmin you see error message:

The phpMyAdmin configuration storage is not completely configured, some extended features have been deactivated. Find out why.
Or alternately go to 'Operations' tab of any database to set it up there.

Follow http://localhost/phpmyadmin/chk_rel.php and click

'Create a database named 'phpmyadmin' and setup the phpMyAdmin configuration storage there'.

You will see:

It means you fixed the problem.

11. Setting up the mail plug

In the C:\Server\bin\ folder, create one more folder named Sendmail. Now in this new folder create a file sendmail.php and copy-paste the following content:

#!/usr/bin/env php
  
<?php
/*  PHP.INI
 *  [mail function]
 *  ;SMTP = localhost
 *  ;smtp_port = 25
 *  ;sendmail_from = me@example.com
 *  sendmail_path = php.exe sendmail.php --dir C:\mail --open
 */
  
$is_windows = stristr(PHP_OS, 'WIN');
$options = getopt("", ['open', 'prepend', 'file:', 'dir:']);
$is_open = isset($options['open']);
$is_prepend = isset($options['prepend']);
$is_onefile = isset($options['file']);
$mail_dir = isset($options['dir']) ? $options['dir'] : sys_get_temp_dir() . '/mail';
$file_name = isset($options['file']) ? $options['file'] : mkname();
$file_path = $mail_dir . '/' . $file_name;
  
if (!is_dir($mail_dir)) {
    mkdir($mail_dir, 0777, TRUE);
    if (!is_dir($mail_dir)) {
        die('Mail folder [' . $mail_dir . '] not created');
    }
}
  
$stream = $is_onefile ? PHP_EOL . str_repeat("-=", 10) . date('Y-m-d H:i:s') . str_repeat("-=", 10) . PHP_EOL : '';
while (false !== ($line = fgets(STDIN))) {
    //$stream .= ($is_windows ? str_replace("\n", PHP_EOL, $line) : $line);
    $stream .= $line;
}
  
if ($is_prepend && file_exists($file_path)) {
    $file_contents = file_get_contents($file_path);
    $stream .= $file_contents;
}
  
file_put_contents($file_path, $stream, $is_prepend ? 0 : FILE_APPEND);
  
if ($is_open && $is_windows) {
    pclose(popen("start /B notepad " . $file_path, "r"));
}
  
function mkname($i = 0) {
    global $mail_dir;
    $fn = 'mail_' . date('Y-m-d_H-i-s_') . $i . '.eml';
    return file_exists($mail_dir . '/' . $fn) ? mkname( ++$i) : $fn;
}

Open the C:\Server\bin\PHP\php.ini file and append the string:

sendmail_path = "C:\Server\bin\PHP\php.exe C:\Server\bin\Sendmail\sendmail.php --dir C:\Server\bin\Sendmail\emails"

Save the file and restart your web-server. From this moment every sent letter will be saved in C:\Server\bin\Sendmail\emails\

12. How to add PHP folder to System PATH in Windows

You should add PHP folder to System PATH, otherwise you will have errors every time you start Apache:

load dynamic library 'C:\\Server\\bin\\PHP\\ext\\php_curl.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\\Server\\bin\\PHP\\ext\\php_intl.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\\Server\\bin\\PHP\\ext\\php_ldap.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\\Server\\bin\\PHP\\ext\\php_pdo_pgsql.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\\Server\\bin\\PHP\\ext\\php_pgsql.dll' - The specified module could not be found.\r\n in Unknown on line 0
[Sat Jan 14 07:09:55.442965 2017] [mpm_winnt:notice] [pid 2032:tid 636] AH00455: Apache/2.4.25 (Win64) PHP/7.1.1RC1 configured -- resuming normal operations
[Sat Jan 14 07:09:55.442965 2017] [mpm_winnt:notice] [pid 2032:tid 636] AH00456: Apache Lounge VC14 Server built: Dec 17 2016 11:15:57
[Sat Jan 14 07:09:55.442965 2017] [core:notice] [pid 2032:tid 636] AH00094: Command line: 'c:\\Server\\bin\\Apache24\\bin\\httpd.exe -d C:/Server/bin/Apache24'
[Sat Jan 14 07:09:55.442965 2017] [mpm_winnt:notice] [pid 2032:tid 636] AH00418: Parent: Created child process 2196
PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\\Server\\bin\\PHP\\ext\\php_curl.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\\Server\\bin\\PHP\\ext\\php_intl.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\\Server\\bin\\PHP\\ext\\php_ldap.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\\Server\\bin\\PHP\\ext\\php_pdo_pgsql.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\\Server\\bin\\PHP\\ext\\php_pgsql.dll' - The specified module could not be found.\r\n in Unknown on line 0
[Sat Jan 14 07:09:55.864736 2017] [mpm_winnt:notice] [pid 2196:tid 584] AH00354: Child: Starting 64 worker threads. 

To avoid that, add PHP folder to System PATH. Push the Start (‘Win’) button, start typing ‘Edit the system environment variables’ and open the setting window.

Click the ‘Environment Variables’ button:

In the window ‘System variables’ click on ‘Path’ and later on ‘Edit…

Click on ‘New’ and type ‘C:\Server\bin\PHP\’:

Lift the record to the very top:

Save changes and close all windows. Restart the server.

13. Configuring cURL in the Apache web server on Windows

If you do not know what cURL is, then you do not need it. So feel free to skip this step.

cURL is a console utility that allows you to exchange data with remote servers using a very large number of protocols. cURL can use cookies and supports authentication. If a web application requires cURL, then this must be specified in the dependencies. For many popular applications, cURL is not required, for example, for phpMyAdmin and WordPress therefore there is no need to configure cURL.

If cURL is not configured correctly, you will get errors:

Fatal error: Call to undefined function curl_multi_init() in …

Or:

Error curl: SSL certificate problem: unable to get local issuer certificate

To make cURL works in Apache on Windows, you need:

1) Be sure to add the PHP directory to PATH (system environment variables). How to do this said just above: https://miloserdov.org/?p=55#12.

2) In the C:\Server\bin\PHP\php.ini file the extension=curl line should be uncommented.

3) Download the https://curl.haxx.se/ca/cacert.pem file, then in the C:\Server\ folder create a new folder named certs and move the downloaded file to this new folder (C:\Server\certs\).

4) In the C:\Server\bin\PHP\php.ini file find the sting

;curl.cainfo =

And replace it with

curl.cainfo = C:\Server\certs\cacert.pem

5) Restart your web-server.

14. Fixing the Asynchronous AcceptEx failed error

When you have hangs, slow traffic and/or when having in your log entries like Asynchronous AcceptEx failed. 

[Thu Jun 05 07:24:55.747090 2014] [mpm_winnt:notice] [pid 1784:tid 444] AH00455: Apache/2.4.9 (Win64) PHP/5.5.13 configured -- resuming normal operations
[Thu Jun 05 07:24:55.747090 2014] [mpm_winnt:notice] [pid 1784:tid 444] AH00456: Apache Lounge VC11 Server built: Mar 16 2014 12:42:59
[Thu Jun 05 07:24:55.747090 2014] [core:notice] [pid 1784:tid 444] AH00094: Command line: 'c:\\Server\\bin\\Apache24\\bin\\httpd.exe -d C:/Server/bin/Apache24'
[Thu Jun 05 07:24:55.748090 2014] [mpm_winnt:notice] [pid 1784:tid 444] AH00418: Parent: Created child process 4952
[Thu Jun 05 07:24:55.957978 2014] [mpm_winnt:notice] [pid 4952:tid 388] AH00354: Child: Starting 64 worker threads.
[Thu Jun 05 07:26:16.695036 2014] [mpm_winnt:warn] [pid 4952:tid 1112] (OS 64)Указанное сетевое имя более недоступно.  : AH00341: winnt_accept: Asynchronous AcceptEx failed.
[Thu Jun 05 07:26:16.695036 2014] [mpm_winnt:warn] [pid 4952:tid 1112] (OS 64)Указанное сетевое имя более недоступно.  : AH00341: winnt_accept: Asynchronous AcceptEx failed.
[Thu Jun 05 07:26:48.250710 2014] [mpm_winnt:warn] [pid 4952:tid 1112] (OS 64)Указанное сетевое имя более недоступно.  : AH00341: winnt_accept: Asynchronous AcceptEx failed.
[Thu Jun 05 07:26:48.250710 2014] [mpm_winnt:warn] [pid 4952:tid 1112] (OS 64)Указанное сетевое имя более недоступно.  : AH00341: winnt_accept: Asynchronous AcceptEx failed.
[Thu Jun 05 07:29:27.137784 2014] [mpm_winnt:warn] [pid 4952:tid 1112] (OS 64)Указанное сетевое имя более недоступно.  : AH00341: winnt_accept: Asynchronous AcceptEx failed.
[Thu Jun 05 07:29:27.137784 2014] [mpm_winnt:warn] [pid 4952:tid 1112] (OS 64)Указанное сетевое имя более недоступно.  : AH00341: winnt_accept: Asynchronous AcceptEx failed.

You can try the following settings:

AcceptFilter http none
AcceptFilter https none
EnableSendfile off
EnableMMAP off

15. How to protect the Apache web server from hacking in Windows

Recommended for you 'How to protect the Apache web server from hacking in Windows'.

How to delete web-server Apache from Windows

If you no longer need a web-server installed with this guide, follow the steps below to uninstall it.

Attention: all the web-sites and their databases created on your local web-server will be deleted!

Stop services and remove them from auto start:

c:\Server\bin\Apache24\bin\httpd.exe -k stop
c:\Server\bin\Apache24\bin\httpd.exe -k uninstall
net stop mysql
c:\Server\bin\mysql-8.0\bin\mysqld --remove

Delete the folder C:\Server\.

Recommended for you:

184 Comments to How to install web server on Windows 10 (Apache 2.4, PHP 8, MySQL 8.0 and phpMyAdmin)

  1. Jeff Holmes says:

    Thanks for this excellent guide. Saved me a lot of time!

  2. Joseph says:

    Thanks so much! I finally have my own PHP7 by following your detailed and clear instructions!

  3. Peter Wilford says:

    This was excellent…  Each step was clear and up to date.  The enabling of sendmail was/is awesome.  Thanks.

  4. Dave says:

    Great guide. However I ran into an issue in running mysqld the fix though is to download and install Microsoft Visual C 2013 (version 12) or try running mysqld.exe manually and you will see the exact DLL that is missing and just Google it. More likely it is just also a missing installation of Visual C.

  5. Alex says:

    The manual is updated:

    • fixed for PHP 7.2
    • added link to Visual C++ Redistributable Packages for Visual Studio 2013 (MySQL requires it)
  6. ChuckGyver says:

    mysql-5.7.20-winx64.zip doesn't have .ini files anymore. And in the chapter 4 you are using 5.7.17

    • Alex says:

      Thanks a lot! I’ve fixed the issue.

      In mysql-5.7 folder you should create my.ini file. Copy-paste lines:

      [mysqld]
      
      sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
      datadir="c:/Server/data/DB/data/"

      It is enough.

      • oyeyemi says:

        Thanks so much for the excellent tutorial. But please i ran into this problem when trying to launch phpmyadmin:

        phpMyAdmin - Error
        The mysqli extension is missing

        • Alex says:

          Did you download PHP 7.2? Because PHP 7.1 configuration differs a little bit. Did you uncomment lines as shown on Step 6? Did you restart Apache after that?

          • oyeyemi says:

            Thanks for your quick response.

            Yes, i downloaded 7.2.

            And i finally got where the problem is : extension_dir = "C:/Apache2/modules/php/ext"

            The above extension directory is commented out by default in php.ini file, so all i did was to uncomment it. So, the problem got solved.

            Thanks so much

      • mozawa says:

        thank sir…

        this method can created new webserver like XAMP MAMP AMPPS… jorgan and more sir

        can you create tutorial additional sir add module for tutorial about sir as below.

        1.server alias

        2.virtual host

        very very good tutorials… i recommanded you create video put in youtube and get some money from advertising… from google… from more subcribe….

        thank

  7. Davy T says:

    Just a quick note thanking you for an EXCEPTIONAL tutorial, Sir. You should make a YouTube video with this content as there is nothing up to date there. I'm sure you'll help a lot of people who go to YouTube first like I did. So disapointed, I turned to google and there you were at the top. Thanks again.

  8. dani says:

    Hi Alex, thanks for the guide.

    by the way I found error when I try to copy paste c:\Server\bin\Apache24\bin\httpd.exe -k install. The warning said "the program can't start because api-ms-win-crt-runtime-l1-1-0.dll is missing from your computer. Try reinstalling the program to fix problem". What should I do?

    thank you.

  9. George says:

    I am extremely impressed, and slightly surprised, that this worked flawlessly. Congratulations on the excellent post and many, many thanks for saving me from having to go back to wamp, xampp or (shudder) IIS.

  10. Asia says:

    Hello. I have problem on step number 4. The files didin't show up, even if I re-install MySQL. Any help? 

  11. Mircea Prodan says:

    Hi!

    I have this error (Windows7):  (phpmyadmin error): missing mysqli.dll

    Can you help me?

    Thanks in advance

  12. Pat Cajaljal says:

    Hi! Why do we have to do step 15? It kinda confuses me a little bit.

  13. john says:

    The best tutorial ever  .. However I ran into an issue in running mysqld .. I did not get all the files in data folder like you .. I got just 5 files

    binlog.index

    ib_logfile1

    ib_logfile101

    ibdata1

    LENOVO.err

    mysql service didn't started at all and when i run    net start mysql  it gives me

    The MySQL service is starting.
    The MySQL service could not be started.

     

    • Alex says:

      To cope the issue, remove all files from C:\Server\data\DB\data\ folder, and to the my.ini file add the line:

      innodb_flush_method=normal

      After that initialize MySQL again:

      C:\Server\bin\mysql-8.0\bin\mysqld --initialize-insecure --user=root
      C:\Server\bin\mysql-8.0\bin\mysqld --install
      net start mysql
      
  14. gorge says:

    You are great

    i tried to make a virtual host .. but it keep gives me the "index of" page and a list of folder on htdocs … but i want the virtual host to open the index page in my project directly

  15. Grateful in Chapel Hill says:

    Thank you SO much for taking the time and effort to share your experience in setting this up. I really like the way you've set things up and your instructions have worked flawlessly for me . You saved me a LOT of time and helped me avoid a tonne of misspent effort. Thank you !

  16. boxecutor says:

    Excellent Guide but i would recommend a rewrite to adjust it so that the mysql root user is not empty password - this is a major security flaw and leaves the system vunerable and open to attacks.

    • Alex says:

      Hello! Thank you for the helpful recommendation. I agree with the importance of this issue. I will write additional article on security issues.

      Running web-server, we have to consider not only the password for MySQL, but also access control to the web-server, access control to the MySQL server (to prevent brute-force), the power of Apache to access the file system outside the web root folder and so on.

      It is very vast subject. It is important, but it is rather difficult for fresh users who just achieved the web-server running.

      Therefore, users concerned about security issues will continue to configure the web-server according to the next level article.

  17. Daniel Martinez says:

    Hi!, this is a great Tutorial TYVM!

    I see in the error.log file messages like this: PHP Warning:  PHP Startup: Unable to load dynamic library 'curl' (tried: C:\\Server\\bin\\PHP\\ext\\curl……………………….

    And i see the file is called "php_curl.dll" in the C:\Server\bin\PHP\ext\.

    Should i change the namesin the php.ini file?

    THIS ERROR ALSO OCCURS WITH  library 'intl', library 'ldap', library 'pdo_pgsql', 'pgsql'.

  18. Daniel Martinez says:

    Hi ver good guide!

    I see in the apache logs error file the next:

    PHP Warning:  PHP Startup: Unable to load dynamic library 'curl' (tried: C:\\Server\\bin\\PHP\\ext\\curl (No se puede encontrar el m\xef\xbf\xbddulo especificado.), C:\\Server\\bin\\PHP\\ext\\php_curl.dll (No se puede encontrar el m\xef\xbf\xbddulo especificado.)) in Unknown on line 0
    PHP Warning:  PHP Startup: Unable to load dynamic library 'intl'………….
    PHP Warning:  PHP Startup: Unable to load dynamic library 'ldap'………….
    PHP Warning:  PHP Startup: Unable to load dynamic library 'pdo_pgsql'…………
    PHP Warning:  PHP Startup: Unable to load dynamic library 'pgsql'…………

    Whath meanas this?

    • Alex says:

      To fix every your issue you have to add PHP folder to System PATH in Windows, please refer to the step ‘12. How to add PHP folder to System PATH in Windows’ of this manual.

  19. csdc says:

    For those who can't get phpmyadmin page, you should restart your mysql and apache server.

  20. rick says:

    LoadModule php7_module "C:/Server/bin/PHP/php7apache2_4.dll"

    There is no such file in the noted directory.  I keep getting the error: httpd.exe: Syntax error on line 537 of C:/Server/bin/Apache24/conf/httpd.conf: Cannot load C:/Server/bin/PHP/php7apache2_4.dll into server: The specified module could not be found.

    • Alex says:

      Did you download Debug Pack, Non Thread Safe or Sources?

      Download the proper version (VC15 x64 Thread Safe) to get the file.

      • rick says:

        Thanks Alex, I solved that problem.  However, I am now tryin to instal a website that generates and writes a config.ini.php to a data directory folder within the website - it is an automated process.  Everything works until I get to about the fourth step - the writing of the config.ini.php file, then I get the error: Warning: parse_ini_file(data/config.ini.php): failed to open stream: No such file or directory in C:\Server\data\htdocs\webtrees\site-unavailable.php on line 47 . The problem seems to be a folder permissions problem that I have tried to fix without success.  Essentially, I have given full control to the system on the data folder.  Nothing that I have tried works and I hope you might be able to help with this issue.

  21. Anonymous says:

    wonderful tutorials even for a beginner like me…….thanks!!

  22. Nazmin says:

    Hello Alex.

    I followed your instructions and everything works fine accept for phpmyadmin. I do not have "Users" or "User accounts" tab in my phpmyadmin. I have logged in as root as my username and leave it blank for password. It says I have no privilege to create database. How can this be solved?

    My phpmyadmin version is 4.8.2

    Web Server

    Apache/2.4.33 (Win64) PHP/7.3.0alpha2

    PHP version: 7.3.0alpha2

     

    • Alex says:

      Unfortunately, I cannot reproduce the bug. Did you depart from the guide in any way?

      Can you make screenshot of the page: http://localhost/phpMyAdmin/sql.php?server=1&db=mysql&table=user

      • Nazmin says:

        I followed the guide as you say and everything works fine. Apache, mysql, php and phpmyadmin can run smoothly. The only problem is on my phpmyadmin. I searched on google and it says users or users account feature might be removed for some security reasons…and now I don't know what to do to enable the privilege to create database. I never use php before.

         

        • Alex says:

          It seems your problem arises from the third-party advice to 'remove user account'. You can ask one more advice from the author of idea to remove – what should you do next.

          You can reset your MySQL installation to make it work fine. To reset run the commands:

          net stop mysql
          c:\Server\bin\mysql-8.0\bin\mysqld --remove

          Purge everything from the C:\Server\data\DB\data\ folder.

          And run again:

          C:\Server\bin\mysql-8.0\bin\mysqld --initialize-insecure --user=root
          C:\Server\bin\mysql-8.0\bin\mysqld --install
          net start mysql
          
          • Nazmin says:

            Thank you so much Alex. It works. 🙂

            This is just my suggestion…maybe you could update and include this problem and how to overcome it in your guide so people can refer to it in the future.

  23. Medo says:

    Can we do the same settings if we want to install MariaDB instead of Mysql !!?

  24. Nursyahira says:

    Hello Alex.

    I got a problem on step 7.

    -phpMyAdmin-error

    -the mysqli extension is missing

    And i have already did uncomment lines as shown on step 6 and restart Apache. But it's still the same. What should i do?

    • Alex says:

      You missed an instruction or did an instruction wrong. Examples what you could do wrong:

      • did not rename php.ini-development to php.ini
      • did not replace ; extension_dir = "ext" with extension_dir = "C:\Server\bin\PHP\ext\"
      • did not add the PHPIniDir "C:/Server/bin/PHP" string in the c:\Server\bin\Apache24\conf\httpd.conf file or did it wrong.

      It is not complete list. However, there is the only one reason: you did something not exactly as in this manual.

      • Abinesh says:

        I had the same problem. Then I replaced backward slash with forward and restarted apache. It then worked!

        extension_dir = "C:/Server/bin/PHP/ext/"

  25. Subject: S.O.S. Phpmyadmin doesn´t run.

    Hi Alex. Thanks for sharing.

    I can´t acces mariadb from phpmyadmin. it shows me the next error: mysqli_real_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: NO).

    I followed your instructions. I installed:

    httpd-2.4.34-win64-VC15.zip, mariadb-10.2.16-winx64.zip, php-7.2.8-Win32-VC15-x64.zip and phpMyAdmin-4.8.2-all-languages.zip.

    Apache and MariaDB services OK.

    Thanks a lot. Have a nice day.

     

     

     

     

  26. hina says:

    After replacing lines of httpd.conf  all When i paste command c:\Server\bin\Apache24\bin\httpd.exe -k install on cmd prompt(admin) it show that Service is already installed.

    when i paste command c:\Server\bin\Apache24\bin\httpd.exe -k start it show that

    httpd.exe: Could not reliably determine the server's fully qualified domain name, using fe80::5612c:1b43:faa2:888f. Set the 'ServerName' directive globally to suppress this message
    (OS 10013)An attempt was made to access a socket in a way forbidden by its access permissions.  : AH00072: make_sock: could not bind to address [::]:80
    (OS 100134)An attempt was made to access a socket in a way forbidden by its access permissions.  : AH00072: make_sock: could not bind to address 0.0.0.0:80
    AH004513: no listening sockets available, shutting down
    AH000415: Unable to open logs

    Please guide to handle this error

    • Alex says:

      Obvious question, did you already install Apache service? Do you have XAMPP or something like that?

      The message:

      Could not reliably determine the server's fully qualified domain name, using fe80::5612c:1b43:faa2:888f. Set the 'ServerName' directive globally to suppress this message..........

      shows that you did not follow the guide exactly. So I don’t have no another advise for you but to reverse all made changes, start from beginning and follow the guide exactly.

      To reverse all made changes, see the ‘How to delete web-server Apache from Windows’ unit.

  27. Robert Villano Muñoz says:

    Hi Great tutorial my friend it was very helpful

  28. Hello friend how do I access mysql and create a database from the windows console?

  29. Anonymous says:

    Thanks it works

  30. Anonymous says:

    Thanks. this was a great tutorial. After I have spent 3 days trying to get these 4 components to run and not able to get a tutorial like this. This is exactly what I wanted to do . Great job.

     

  31. Sunil says:

    Excellen guiding. I could configure everything without even hitch. It works wonderfully well. Thanks a lot.

  32. Sodrick says:

    Big thannks to you sir. Can we add xdebug on server and how?

  33. conan says:

    Hi Alex,

    Im having similar issues at step 4 as others, but the suggestions do not seem to help.

    C:\WINDOWS\system32>net start mysql
    The MySQL service is starting…
    The MySQL service could not be started.

    The service did not report an error.

    More help is available by typing NET HELPMSG 3534.

    Would you be able to assist, thanks

  34. Mani says:

    Hi!

    I have this error (Windows7):  (phpmyadmin error): missing mysqli.dll

    Can you help me? Tried all kind of changes. Still doesn't works. 

    Thanks in advance

  35. Bibih Rosmie Binti Someiun says:

    thank you!

  36. Isak says:

    Thank you, great tutorial. Clear, straight forward, easy to follow. Excellent work.

  37. ilan says:

    I'm having trouble at part 3 already.. i replaced all the things you said and then i got a problem with some sockets or something. i then changed the listen to 90 from 80 and it allowed to do the c:\Server\bin\Apache24\bin\httpd.exe -k start with no problem but then when i try to run the  http://localhost/  i get 

    Not Found

    HTTP Error 404. The requested resource is not found.

     

    not sure what to do.

    Thanks in advance!

    • Alex says:

      I am sure that reset of your installation and following the instructions exactly will fix the issue.

      Probably you did not create the folder structure or missed one or more steps in Apache configuration process.

  38. chan says:

    USE : mysql-8.0.13-winx64

    C:\WINDOWS\system32>net start mysql

    The MySQL service is starting.
    The MySQL service could not be started.

    The service did not report an error.

    Would you be able to assist, thanks

    • Alex says:

      Hello! What messages in the C:\Server\data\DB\data\*.err file?

      The file name can differ, it is located in the C:\Server\data\DB\data\ folder and has the .err file extension.

      • Anonymous says:

        Hello!

        .err file extension located in C:\Server\data\DB. There is no file in C:\Server\data\DB\data\ .I got this error msg. I can't use net start mysql. so i used .\net start mysql.

        C:\WINDOWS\system32> .\net start mysql
        The MySQL service is starting…
        The MySQL service could not be started.The service did not report an error.

        More help is available by typing NET HELPMSG 3534.

        Thank a lots!

  39. Shivansh Mittal says:

    i am getting error when i open this link: http://localhost/phpmyadmin/&nbsp;

    the error is:-

    The mysqli extension is missing. Please check your PHP configuration. See our documentation for more information.

    please help

  40. Sid says:

    Hello Alex, I followed your guide to configure Apache and PHP on my Win10 Laptop. It worked perfectly till Apache config. After I add the i.php file, I do not get to see the php info. I get the error "ERR_CONNECTION_RESET". I have installed php and apache in C:/Server/Apache24 and C:/Server/php folders. My website directory is D:/Website. I have changed the paths in the httpd.conf file to match this.  I restarted the server multiple times but no help. Can you help me troubleshoot the issue plz?

    • Luigi says:

      Same for me. I've also tried this code :

      <?php
      phpinfo();
      ?>

      but doesn't work…

    • Luigi says:

      The problem is in PHP versione that make crash the apache on startup (see the Apache24/logs/error.log)

      The 'Apache2.4' service is running.
      ore:warn] [pid 6360:tid 652] AH00098: pid file C:/Server/bin/Apache24/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
      PHP Warning: 'vcruntime140.dll' 14.15 is not compatible with this PHP build linked with 14.21 in Unknown on line 0
      [Wed Jul 24 11:58:49.124361 2019] [:emerg] [pid 6360:tid 652] AH00020: Configuration Failed, exiting

      Download the PHP 7.3.7 (php-7.3.7-Win32-VC15-x64.zip) that is more stable than php-7.4.0beta1.

      That solved the problem for me

  41. Alex says:

    Please come to the original page https://miloserdov.org/?p=55, and in your web browser press Ctrl+F and try to search the command you've written: it does not exist in my article.

    I guess you use Google Translator or another program to translate. It breaks commands in this guide. You can use Google Translator to read text, but you should copy commands from the original page.

  42. Simphiwe says:

    You writting skills are very excellent work @Alex. You have solved problem for many other people. Kudos to you.

    You have just left-out the following 2 points which already exists in your previous page : https://miloserdov.org/?p=2343. Can you please include these line in your documentation

    1. Download PHP

    To download PHP for Windows, go to windows.php.net/download/. There select the file VC15 x64 Thread Safe or VC15 x86 Thread Safe. Note: you need to download the Zip file (and not the Debug Pack).

    2. phpMyAdmin

    To do this, open the command line, enter:

    1

    2

    cd C:\Server\bin\mariadb\bin\

    .\mysql -u root

    Inside MySQL:

    1

    2

    3

    FLUSH PRIVILEGES;

    ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';

    exit;

    Replace new_password with your actual password.

    3. Suggestions

    If I may ask for some suggestion - could please write the following topics:

    3.1 How to install Virtual Machine on WAMP

    3.2 How to install Linuxmint from USB

    3.3 How to install Virtual Machine on Linuxmint

  43. ValTod says:

    Excellent tutorial! Today 1.13.2019 I followed it with the newest versions of the software:
    httpd-2.4.37-win64-VC15.zip
    php-7.3.1RC1-Win32-VC15-x64.zip
    mysql-8.0.13-winx64.zip
    phpMyAdmin-4.8.4-all-languages.zip

    I had to do only two changes. In php.ini:
    ; On windows:
    extension_dir = "C:\Server\bin\PHP\ext"

    ( If you don't add this, PHP cannot find the mysqli extension. phpMyAdmin won't start adn throw the error: The mysqli extension is missing)

    In config.inc.php specify your language:
    $cfg['DefaultLang'] = 'en';

    Other than that everything worked flawlessly. Again, excellent tutorial!

  44. codeRex says:

    Hello bro,

    I know you might be busy with some other stuffs, but can you help me with the following problems i encountered….

    firstly, I downloaded the latest version of all the required files (httpd-2.4.37-x64-vc11-r2, phpMyAdmin-4.8.5-all-languages, mysql-8.0.15-winx64 and php-7.3.0-Win32-VC15-x64.

    but i got these error….

    the first is while trying to start sql.

    the second is while trying to login to phpmyadmin.

    I initially ignored the first error and went on to setup phpmyadmin; I only get to see the phpmyadmin login page.

    Thanks in advance.

    • Alex says:

      Hello! I don't see any errors on your screenshot. There are some warnings (not critical) and information messages. You can try to login in phpMyAdmin with ‘root’ as a user and with empty string as a password.

      By the way, where did you download Apache? On https://www.apachelounge.com/download/ where I recommend to download binaries for Windows the actual version is Apache 2.4.38 Win64. And as a user of the web site at least the last 10 years, I’ve never seen release candidate (r2) versions there.

      My guide guarantee works only if follow it literally.

  45. Alex says:

    Everyone who has issues with MySQL service, to fix it try:

    1. Remove the service:

    net stop mysql
    c:\Server\bin\mysql-8.0\bin\mysqld --remove

    2. In the c:/Server/data/DB/data/ folder remove all files

    3. Initialize and install the service:

    C:\Server\bin\mysql-8.0\bin\mysqld --initialize-insecure --user=root
    C:\Server\bin\mysql-8.0\bin\mysqld --install
    net start mysql

    If the problem persists please provide the content of the C:\Server\data\DB\data\*.err file.

  46. Alexandre Martignier says:

    Very usefull step-by-step guide! Works like a charm for me, thanks!

  47. Hold in mind that youu can constantly add elements later.

  48. Matt says:

    SWEET and much thanks. I don't think I could have installed the web server so smoothly.  My only pain was not being able to log in phpMyAdmin because it wants a password. I found that I have to change one line in the my.ini in the mysql-8.0 folder from

    datadir="c:/Server/data/DB/data/"

    to

    datadir="c:/Server/bin/mysql-8.0/data.

    I used mysql 8.0.15 and phpMyAdmin 4.8.5. The data files that were created when sql was installed did not go to the "/Server/data/DB/data" folder. They went automatically to the "Server/bin/mysql-8.0/data" folder.

     

  49. Sandhan says:

    Hlw Sir!

    I have a problem in configuring Apache2.4, it is showing error that "AH00526: Syntax error on line 250 of C:/Server/bin/Apache24/conf/httpd.conf:
    DocumentRoot 'C:/Server/data/htdocs/' is not a directory, or is not readable".

    Plz.tell fast .

    • Alex says:
      • DocumentRoot 'C:/Server/data/htdocs/' is not a directory, or is not readable" means you did not create the C:/Server/data/htdocs/ folder.
      • <DocumentRoot> was not closed means you have syntax error on the corresponding line.

      All in all, these problems only because you did not follow this guide literally.

      Start with a cup or a couple cups of coffee and redo the guide from the beginning.

  50. mgwai says:
    Windows PowerShell
    Copyright (C) Microsoft Corporation. All rights reserved.
    
    PS C:\WINDOWS\system32> C:\Server\bin\mysql-8.0\bin\mysqld --initialize-insecure --user=root
    mysqld: [ERROR] Found option without preceding group in config file C:\Server\bin\mysql-8.0\my.ini at line 1.
    mysqld: [ERROR] Fatal error in defaults handling. Program aborted!
    PS C:\WINDOWS\system32>
    
    • Alex says:

      Please check your C:\Server\bin\mysql-8.0\my.ini file and compare your file with the file in this guide.

      • mgwai says:

        it working now. thanks Alex. But phpmyadmin not working for google chrome Got this msg "Failed to set session cookie. Maybe you are using HTTP instead of HTTPS to access phpMyAdmin". When I Tried using microsoft edge i can login to phpmyadmin. Any solution for google chrome? Thanks in advance 

  51. ian says:

    Thank you so much, had a couple of problems, but when I re-did all steps for good measure it all worked perfectly. I saved me days of time. Great work.

  52. Anonymous says:

    Thanks for the post!

  53. JOJ says:

    In step 5, when I run the command:

    c:\Server\bin\Apache24\bin\httpd.exe -k restart

    I got the error:

    httpd.exe: Syntax error on line 539 of C: /Server/bin/Apache24/conf/httpd.conf: Can not load C: /Server/bin/PHP/php7apache2_4.dll into server: The specified module could not be found. 

    How to fix this?

  54. Anonymous says:

    The directory slashes don't match, 1 set is forward, 1 is backward.

  55. Edwin Elowsson says:

    Hi
    I don't know if it comes under this topic.
    Everything works fine, but when I install wordpress, their test page appears fine on localhost, but not on another local PC, or on external PCs
    regards Edwin

  56. William says:

    Hi at the end of part 5 where it says add the code to i.php and type in the web browser http://localhost/i.php it doesn't show me the same result. Instead it just shows the code in the i.php file

  57. Ibrahim says:

    2019-04-11T11:09:26.617968Z 0 [Warning] [MY-010915] [Server] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
    2019-04-11T11:09:26.618063Z 0 [System] [MY-013169] [Server] C:\Server\bin\mysql-8.0\bin\mysqld (mysqld 8.0.15) initializing of server in progress as process 2388
    2019-04-11T11:09:26.620830Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.
    2019-04-11T11:09:26.621148Z 0 [ERROR] [MY-013236] [Server] Newly created data directory c:\Server\data\DB\data\ is unusable. You can safely remove it.
    2019-04-11T11:09:26.628421Z 0 [ERROR] [MY-010119] [Server] Aborting
    2019-04-11T11:09:26.628549Z 0 [System] [MY-010910] [Server] C:\Server\bin\mysql-8.0\bin\mysqld: Shutdown complete (mysqld 8.0.15)  MySQL Community Server - GPL.

    How to fix?
     

  58. Ambarish says:

    i am havig the error 1356.

    initially the error was 1449 and when  i fixed it ,then this error raised.

    how to fix this error.

  59. Carmine says:

    I had problems with XAMPP with my MediaWiki installation. I followed this guide and managed then to have MediaWiki working quickly and smoothly: thank You so much.

            Carmine

       

  60. Anonymous says:

    When I appened this to httpd.conf, Apache stops and dose not restart

     

    PHPIniDir "C:\Server\bin\PHP"
    AddHandler application/x-httpd-php .php
    LoadModule php7_module "C:/Server/bin/PHP/php7apache2_4.d

    • Alex says:

      Hello! In the comment you misspelled the string, please double check you configuration file:

      C:/Server/bin/PHP/php7apache2_4.dll

  61. Yudha says:

    Hi Alex

    Your installation guide is very awesome.

    I want to ask when I try to copy sample project in htdocs, localhost cannot read it. Would you mind to explain that?

     

    Thanks

    • Alex says:

      Hello! What the exact error message did you get? Or can you provide a screenshot please?

      At what folder (full path) did you put your files?

  62. Bill Dickson says:

    Thanks!!!  The instructions are clear, and I have a functioning server without the problems of xampp, wamp, uniserver, or other prefabs that I tried. While the concise instructions are amazing, it might be nice to offer an explanation of what some of the settings in httpd.conf, my.ini, and php.ini are actually doing.  Maybe not, though . . . then it may get bogged down.

    Great work! Thanks again.

  63. SNB says:

    I start the Apache 2.4 icon on the process bar and the command window flashes but naturally the process has stopped.

    Can you help me? 

    I have no problem on another Window 10 OS and Window 7 system on older computers (using Apache 2.2 and PHP 5.). These won't run on my new Windows 10 pc, so I found your recipe for the suite of Apache-PHP-MySQL but although I followed it closely I am stuck at the Apache stage.

    Thanks…

    PS. I changed "localhost:8080" back to "localhost" in httpd.exe.

    • Alex says:

      Hello!

      The last command succeeded and no errors arsed. So what is the problem? Apache should work.

      • Anonymous says:

        Thanks for inspecting it, Alex, and it is mystifying. It seems to be correctly installed and running, but still httpd.exe connects for a fraction of a second and is somehow blocked.

        I have the same virus checker on all my pc's and the same firewall settings.

        Also searched for processes (services.msc) to deactivate anything that could be blocking it.

        Still my browser can't seem to find the localhost.

        • Alex says:

          What if to open http://127.0.0.1/ ?

          In addition, try in command line (PowerShell) execute the commands:

          ping localhost

          And the next:

          ping 127.0.0.1

          And:

          curl -v localhost

          And:

          curl -v 127.0.0.1

          Please take screenshots or copy-paste the output of commands here, in the comment section.

          • Sandra says:

            Thanks Alex. 

            Hope the screenshots give some info. 

            The following comment by Luigi mentions a newer version of PHP as a solution, but I haven't reached that steip in your installation process.

            (Have a 64 bit OS.)

            Thanks for the help!

          • Alex says:

            The problem is still unclear for me. Please check the C:\Server\bin\Apache24\logs\error.log file. What is its content?

          • Sandra Britz says:

            Thanks Alex.

            The error.log file hasn't been able to be opened since August 6, while I have tried to run httpd.exe many times after that.

            I send you copies of the log files and a print of the PowerShell process I just set in motion a moment ago.

            Thanks a lot for trying to find my mistake(s).

            Sandra

          • Alex says:

            Well, what I see the web server is accessible and functional, but does not reply for requests. I guess you have wrong setting of the Listen directive in the c:\Server\bin\Apache24\conf\httpd.conf file.

            Try the default setting:

            Listen 80

            And restart the web server.

          • Sandra Britz says:

            Thousand thanks, Alex!!!

            Given your hint, I hurriedly opened the "new" port and realised that I had been using https://localhost…etc. (and not http://).

            You have been very helpful and I greatly appreciate your patience.

             

        • Luigi says:

          Quoting for previous reply, may help here:

          The problem is in PHP version that make crash the apache on startup (see the Apache24/logs/error.log)

          The 'Apache2.4' service is running.
          ore:warn] [pid 6360:tid 652] AH00098: pid file C:/Server/bin/Apache24/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
          PHP Warning: 'vcruntime140.dll' 14.15 is not compatible with this PHP build linked with 14.21 in Unknown on line 0
          [Wed Jul 24 11:58:49.124361 2019] [:emerg] [pid 6360:tid 652] AH00020: Configuration Failed, exiting

          Download the PHP 7.3.7 (php-7.3.7-Win32-VC15-x64.zip) that is more stable than php-7.4.0beta1.

          That solved the problem for me

  64. I enjoy, lead to I found just what I was having a look for.
    You have ended my 4 day lengthy hunt! God Bless you man. Have a
    nice day. Bye

  65. Tom says:

    Fantastic! Such well writtten documentation! Made my life so much easier. Really appreciate the time and effort hat you put into this.

  66. maggi says:
    Syntax error on line 251 of C:/Server/bin/Apache24/conf/httpd.conf:
    DocumentRoot 'C:/Server/data/htdocs/' is not a directory, or is not readable

    how do i fix it?

  67. maggi says:

    AH00558: httpd.exe: Could not reliably determine the server's fully qualified domain name, using fe80::556f:d90a:5f6b:fdee. Set the 'ServerName' directive globally to suppress this message

    how do i fix it?

    • Alex says:

      Being on this page, press F3 and enter the text:

      ServerName localhost

      You will reach the place on the page containing the next tips…

      The main advice, please follow the manual, it already contains answers for the all similar questions.

  68. maggi says:

    in step 3, ending, when i opened the link in my browser, i got

    Forbidden

    You don't have permission to access this resource.

    what should i do?

  69. MegaX says:

    Hi,

    When I get to step 5 and go to http: //localhost/i.php. Stays like this:

  70. joe says:

    I am having almost similar issue as MegaX and not sure what the probem is though the file reside in C:/Server/data/htdocs/i.php the file is listed index of / 

    [php7:error] [pid 3228:tid 884] [client ::1:52582] script 'C:/Server/data/htdocs/i.php' not found or unable to stat

     

  71. Alex says:

    On March 1, 2020, the tutorial was verified with the latest version of Windows (build 1909) and with the latest web server components (Apache 2.4.41, PHP 7.4, MySQL 8.0.19, phpMyAdmin 5.0.1). Everything works fine, if it’s done according to the instructions precisely.

  72. Ankit Raj says:

    Sir, when i extract the PHP file as in Step 5 and create i.php i can't get the PHP message as in provided image. when i run localhost/i.php it always display a message, "This site can’t be reached. The connection was reset.". Is my PHP installed?

    Should i move to further steps? Please help me 

    • Alex says:

      Hello! Sorry for bad news, but even your Apache is not set properly. Please pay attenttion to c:\Server\bin\Apache24\conf\httpd.conf file. You missed something there. I recommend you to replace your file with original one and repeat the third step.

      • Ankit Raj says:

        But when I run localhost normally, there is no error and my files like index.html are also running without any error. Should I really update my config files of apache? and also when I install phpmyadmin, it is showing an error "There is a mismatch between HTTPS indicated on the server and client. This can lead to a non working phpMyAdmin or a security risk. Please fix your server configuration to indicate HTTPS properly."

         

         

        • Alex says:

          I don’t understand, how is it possible to open phpMyAdmin if you cannot open http://localhost/i.php ? What do you see when open http://localhost or any other files?

          What is in C:\Server\bin\Apache24\logs\error.log file?

          Did you further customize your Apache installation beyond this tutorial?

          • Ankit Raj says:

            When I try to access http://localhost it normally shows Index of and I have also created a index.html file and it works normally showing html on Chrome browser with CSS styling also. But the problem is only with phpmyadmin and those i.php file. When I enter localhost/phpmyadmin it says same message "localhost refused to connect" . I was getting the same error with Xampp as well as Wamp server. That is the reason only I tried to install Apache manually but nothing happens. Error coming again.

            • Alex says:

              I think I know the reason. You try to open via HTTPS protocol, right? Actually you use https://localhost/i.php, instead of http://localhost/i.php. Is it correct? Click this link, what do you see?

              • Ankit Raj says:

                Sorry to disturb you, but on using HTTP: I am getting the same error on i.php and also when i try to access phpmyadmin my browser shows basic HTML structure, means very different website than your (provided screenshot) and when i enter root as admin and no password, it shows message that connection to localhost was reset. I can not understand what is the problem with my system. I have windows 10 OS.

  73. Ankit Raj says:

    Sorry to disturb you, but on using HTTP: I am getting the same error on i.php and also when i try to access phpmyadmin my browser shows basic HTML structure, means very different website than your (provided screenshot) and when i enter root as admin and no password, it shows message that connection to localhost was reset. I can not understand what is the problem with my system. I have windows 10 OS.

  74. Gio says:

    Hi Alex, i've followed your guide and everything seems to work fine. I just have a weird issue: when i set "php.validate.executablePath": "C:\php\php.exe" (i decided to put 'php' folder out of Apache folder) on settings.json of VS Code i receive this error message:

    Cannot validate since C:\php\php.exe is not a valid php executable. Use the setting 'php.validate.executablePath' to configure the PHP executable.

    I've tried many ways, playing on path string (such as C:\\php\\php.exe or C://php//php.exe or c:\php\php.exe) but nothing works. But when i type localhost/i.php all seems to be correctly set. I know VS Code it's not part of your guide, but if you can help me i'd really appreciate. Thanks in advance, Gio

    P.S.: i've installed 'httpd-2.4.41-win64-VS16' and 'php-7.4.4-Win32-vc15-x64'. Also added c:\php\ to windows sytem path.

    • Alex says:

      Hello! Yes, your question is beyond the scope of my activity. I saw the next example of notation:

      {
        "php.validate.executablePath": "c:/php/php.exe"
      }

      Another idea is to update all components (PHP and VS Code) to the latest releases, for example, PHP 7.4.

  75. Rémi says:

    For those who experienced problems with PHP Warning:  PHP Startup: Unable to load dynamic library 'curl' on Apache start, the solution is to add on top the php home directory ("c:\Server\bin\PHP\") to the system (NOT user!) PATH environment and rebooting the system. When Apache is installed as a service it is run as a system user which means it does not see your user environment variables.

  76. Jacksony Jean-Noel says:

    Before starting the configuration, i have took my time to read the tuto, after reading it, i started the configuration without missing any point. After installing and configuring all the required tools, I have made a test and everithing was OK. 

    So, thanks a lot. The tuto is very, very good. I can say that this tuto about server confiruration on windows, is one the best. 

    Good Job.

  77. Adrian says:

    Hi,
    Excellent guide. Clear and to the point. Thank you.
    One little suggestion […I do not know if that matters or not?]
    In Step 7, the default language in the config file for phpMyAdmin is given as Russian.
    Perhaps a note to the users so that they would change it according to their own locale?

  78. Alex says:

    The instruction has been updated for PHP 8.

    As usual, if the text differs from the screenshots, then you need to follow the text – I will update the screenshots later.

  79. PEDRO says:

    BUENAS TARDES. EXCELENTE TUTORIAL MUCHAS GRACIAS

    TENGO UN PROBLEMA AL QUERER INGRESAR AL http://localhost/i.php, me da error que no puede acceder al sitio web. Apache esta inicializado sin ningun error, ni problema. Tengo instalado windows 10 64b, y las ultimas actualizaciones del los programas.

    httpd-2.4.46-win64-VC15.zip

    php-8.0.0-Win32-vs16-x64.zip

    mysql-8.0.22-winx64.zip

    phpMyAdmin-5.0.4-all-languages.zip

    vc_redist.x64.exe

    • Alex says:

      Greetings! The reason for this error is that the web server is not running. Try to run it:

      c:\Server\bin\Apache24\bin\httpd.exe -k start

      and examine the error message that will be shown.

  80. Daniel O.F. says:

    Thank you very much for this awesome tutorial.

  81. Anonymous says:

    Thank you for this tut. I know this has been an old post. I have this problem when login to phpmyadmin. Fatal error: Maximum execution time of 30 seconds exceeded in C:\Server\data\htdocs\phpmyadmin\libraries\classes\ErrorHandler.php on line 176 . what could be the problem. Thank you

  82. neil says:

    Marvelous! Following you is much better than installing WAMP.

  83. olga says:

    hi!!! how can i fix this? hank you!!!

    • Alex says:

      Hello! Did you install according to these guide?

      • olga says:

        yes I followed this guide, I don't know maybe I did something wrong, up to this point everything worked

        • Alex says:

          You are not the first to report this error. But I cannot reproduce it under any circumstances.

          I found a file that contains the specified string, this is the platform_check.php file. I ran it directly and got the following message:

          Composer detected issues in your platform:
          Your Composer dependencies require the following PHP extensions to be installed: hash, openssl

          That is, my system also does not meet Composer's requirements (by the way, what is it and why are its files placed in phpMyAdmin?), but with normal web server use, I never encounter this error.

          Judging by the fact that you do not have the mysqli and openssl extensions loaded, for some reason your system does not use the settings from the php.ini file, you can verify this by running in the command line:

          C:\Server\bin\PHP\php --ini

          The output should include the path to the file C:\Server\bin\PHP\php.ini. If this is not the case, then perhaps you did not rename the file in php.ini, or called it php.ini.txt or something like that.

  84. iQuipe says:

    when i start my apache i get this error of not finding modules/mod_actions.so

    when i check the modules folder i see it what is the problem, below is the error

    PS C:\WINDOWS\system32> c:\Server\bin\Apache24\bin\httpd.exe -k start
    httpd.exe: Syntax error on line 75 of C:/server/bin/Apache24/conf/httpd.conf: Cannot load modules/mod_actions.so into server: The specified module could not be found.
    PS C:\WINDOWS\system32>

     

     

    • Alex says:

      Hello! After installing Apache, the file C:\Server\bin\Apache24\modules\mod_actions.so must be present in the OS. Perhaps when copying the Apache24 folder, the modules folder was not copied. Check the folder and file.

      Another possible cause of the error is incorrect setting of directives:

      Define SRVROOT "c:/Server/bin/Apache24"
      ServerRoot "${SRVROOT}"
      
  85. Yuri says:

    Good afternoon, Alex! 

    I downloaded:
    1) mysql-8.0.11-winx64.zip ;
    2) phpMyAdmin-4.7.6-all-languages.zip
    I have installed:
    Apache Version Apache/2.4.37 (Win64) OpenSSL/1.0.2q PHP/7.3.0
    But all this is already installed in such folders:
    Server Root C:/Apache24
    Loaded Configuration File C:\php\php.ini
    PATH C:\php;C:\Apache24;
    My question is: will phpMyAdmin and SQL work in this case?

  86. Yuri says:

    Good afternoon, Alex!

     

    Everything worked out!

     

    http://localhost/phpmyadmin/

     

    But phpmyadmin reported such warnings:

     

    Warning in .\libraries\config\FormDisplay.php#661

     "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?

     

    Backtrace

     

    .\vendor\composer\ClassLoader.php#444: include()

    .\vendor\composer\ClassLoader.php#322: Composer\Autoload\includeFile(string 'C:\\Apache24\\htdocs\\phpmyadmin\\vendor\\composer/../../\\libraries\\config\\FormDisplay.php')

    Composer\Autoload\ClassLoader->loadClass(string 'PMA\\libraries\\config\\FormDisplay')

    .\libraries\config\PageSettings.php#76: spl_autoload_call(string 'PMA\\libraries\\config\\FormDisplay')

    .\libraries\config\PageSettings.php#230: PMA\libraries\config\PageSettings->__construct(

    string 'Navi_panel',

    string 'pma_navigation_settings',

    )

    .\libraries\navigation\Navigation.php#66: PMA\libraries\config\PageSettings::getNaviSettings()

    .\libraries\Header.php#425: PMA\libraries\navigation\Navigation->getDisplay()

    .\libraries\Response.php#260: PMA\libraries\Header->getDisplay()

    .\libraries\Response.php#273: PMA\libraries\Response->_getDisplay()

    .\libraries\Response.php#432: PMA\libraries\Response->_htmlResponse()

    PMA\libraries\Response->response()

     

    My question is: How do I fix this?

  87. Yuri says:

    Decision: on line 661, replace continue with break (keep the semi-colon). Reload the page.

Leave a Reply

Your email address will not be published. Required fields are marked *