How to install web server on Windows 10 (Apache 2.4, PHP 7, 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
  • vcredist_x64.exe

Run and install the vc_redist.x64.exe and vcredist_x64.exe files, we will not return to them.

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)

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

5. Installation PHP 7 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 php7_module "C:/Server/bin/PHP/php7apache2_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 7

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=fileinfo
;extension=gd2
;extension=gettext
;extension=gmp
;extension=intl
;extension=imap
;extension=interbase
;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=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=fileinfo
extension=gd2
extension=gettext
extension=gmp
extension=intl
extension=imap
;extension=interbase
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=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=sqlite3
;extension=tidy
;extension=xmlrpc
;extension=xsl

They should look like:

extension=soap
extension=sockets
extension=sqlite3
extension=tidy
extension=xmlrpc
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]['extension'] = 'mysqli';
$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'] = 'ru';
$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

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:

81 Comments to How to install web server on Windows 10 (Apache 2.4, PHP 7, 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 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 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 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

  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 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 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 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 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 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 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 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.

  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 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.

Leave a Reply

Your email address will not be published.

Please consider supporting this blog

Love the stuff I create? Please consider donating to help things rolling faster! miloserdov.org/?p=1460