[php] Apache shutdown unexpectedly

I am using XAMPPS to host PHP files from my machine. I have recently installed XAMPPs but I am unable to start Apache service as port 80 is in use by PID 4 - NT Kernel & System.

I know by using a different port (such as port 8080 etc change in httpd.conf) will get to a workaround for this issue. However I need port 80 to be released by PID 4 process and allocated to Apache service. I have done that in the past but have forgotten the resolution steps over the time. Please help me fix it

This is the error I am encountering while starting Apache

`11:19:52 AM  [Apache]  Error: Apache shutdown unexpectedly.`
`11:19:52 AM  [Apache]  This may be due to a blocked port, missing dependencies,` 
`11:19:52 AM  [Apache]  improper privileges, a crash, or a shutdown by another method.`
`11:19:52 AM  [Apache]  Press the Logs button to view error logs and check`
`11:19:52 AM  [Apache]  the Windows Event Viewer for more clues`
`11:19:52 AM  [Apache]  If you need more help, copy and post this`
`11:19:52 AM  [Apache]  entire log window on the forums`

Logs from apache error log file:

[Wed Jul 03 00:54:17.004882 2013] [mpm_winnt:notice] [pid 248:tid 240] AH00354: Child: Starting 150 worker threads.
[Wed Jul 03 01:17:37.485351 2013] [mpm_winnt:notice] [pid 4200:tid 228] AH00428:    Parent: child process 248 exited with status 1073807364 -- Restarting.
[Wed Jul 03 08:51:45.875976 2013] [ssl:warn] [pid 400:tid 228] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Wed Jul 03 08:51:46.188476 2013] [core:warn] [pid 400:tid 228] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Wed Jul 03 08:51:46.844726 2013] [ssl:warn] [pid 400:tid 228] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Wed Jul 03 08:51:49.047851 2013] [mpm_winnt:notice] [pid 400:tid 228] AH00455: Apache/2.4.4 (Win32) OpenSSL/0.9.8y PHP/5.4.16 configured -- resuming normal operations
[Wed Jul 03 08:51:49.047851 2013] [mpm_winnt:notice] [pid 400:tid 228] AH00456: Server built: Feb 23 2013 13:07:34
[Wed Jul 03 08:51:49.047851 2013] [core:notice] [pid 400:tid 228] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache
[Wed Jul 03 08:51:49.063476 2013] [mpm_winnt:notice] [pid 400:tid 228] AH00418: Parent: Created child process 5384
[Wed Jul 03 08:51:50.579101 2013] [ssl:warn] [pid 5384:tid 240] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Wed Jul 03 08:51:51.579101 2013] [ssl:warn] [pid 5384:tid 240] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Wed Jul 03 08:51:51.750976 2013] [mpm_winnt:notice] [pid 5384:tid 240] AH00354: Child: Starting 150 worker threads.

NOTE: I DO NOT HAVE IIS, WEB CLIENT, WORLD WIDE WEB SERVICE.

This question is related to php apache xampp port

The answer is


On your XAMPP control panel, next to apache, select the "Config" option and select the first file (httpd.conf):

there, look for the "listen" line (you may use the find tool in the notepad) and there must be a line stating "Listen 80". Note: there are other lines with "listen" on them but they should be commented (start with a #), the one you need to change is the one saying exactly "listen 80". Now change it to "Listen 1337".

Start apache now.

If the error subsists, it's because there's another port that's already in use. So, select the config option again (next to apache in your xampp control panel) and select the second option this time (httpd-ssl.conf):

there, look for the line "Listen 443" and change it to "Listen 7331".

Start apache, it should be working now.


Your XAMPP restarting with following error at Multi-Processing Module mpm

 [mpm_winnt:notice] [pid 4200:tid 228] AH00428:    
`Parent: child process 248 exited with status 1073807364 -- Restarting.`

Add the following in the httpd.conf file of xampp to resolve this.

<IfModule mpm_winnt_module>
  ThreadStackSize 8388608
</IfModule>

I shut down the computer and restarted after installing the software and that fixed my problem.


In my situation I had moved the htdocs to a new location updated in httpd.conf, which worked fine. I then received the same error after updating the httpd-vhost.conf file.

I found that the error was caused by a typo in the vhost configuration file. Previously I changed all "DocumentRoot" ’s to the new htdocs location, but had forgot to update the new location for "ErrorLog". After correcting the missing path, Apache was running smooth again.


I have also faced the same issue while installing the XAMPP. The reason being the port 80 as configured in httpd.conf is already in use in other application (eg., in Skype). You can change the port value in httpd.conf to 8080 or other number. Click on config icon and open http.conf file. Search for 80 and do the following steps

In httpd.conf change
Listen 80 to Listen 8080
and
ServerName localhost:80 to
ServerName localhost:8080

You can check the ports used currently by clicking on netstatt icon in the XAMPP Control Panel


If you are using the latest Skype, go to:

Tools -> Options -> Advanced -> connection.

Disable the 'Use port 80 and 443 for alternatve.. '
Sign Out and Close all Skype windows. Try restart your Apache again.


This problem may occur because of skype installation in the system. Skype and apache service always conflict. Make sure your skype is not started before starting xampp.


That is because IIS is automatically running on your machine. IIS occupied both port 80 and 443.

I uninstalled IIS for using Apache httpd.


Stop the IIS service. It should work then


It means port 80 is already used by another one.

Simply follow these steps:

  1. Open windows -> click on Run (win + R) -> type services.msc
  2. Goto IIS Admin -> Right click on it and click on Stop Option.
  3. Open XAMPP click on Start Action of Apache Module, Apache Module is run.

OR

For find the port of Apache (80) in Command Prompt simply type netstat -aon it displays present used ports on windows, under Local Address column it shown as 0.0.0.0:80. If it displays this port another connection is already used this port number.

Active Connections in Windows XP:

Active Connections in Windows XP

I solved my problem after installing xampp-win32-1.6.5-installer previously I used xampp version xampp-win32-1.8.2-0-VC9-installer at that time I got this error. Now it resolved my problem.


i think the error is here

[pid 5384:tid 240] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name

or there is another app are using the port 80 try restarting your computer and only opening apache and see what happens

or try on reinstalling apache or using Ampps


You can disable port 80 and 443 as alternative incoming connections in Skype settings - Advanced settings - Connection.

disable alternative incoming connections
(source: ctrlv.in)


I had a similar issue (that is the reason I come to this thread) that originated from a typo in httpd-vhosts.conf

instead of <VirtualHost domain-name:80> I accidentally wrote (through copy-paste) as <domain-name *:80>


You shuld run file setup_xampp.bat in XAMP folder first!


Follow these:

  1. open your xampp control panel then click its "config"
  2. choose the "Apache (httpd.conf)" and find this code below and change it into this one:

    # Change this to Listen on specific IP addresses as shown below to 
    # prevent Apache from glomming onto all bound IP addresses.
    #
    #Listen 0.0.0.0:80
    #Listen [::]:80
    Listen 80
    #
    # Dynamic Shared Object (DSO) Support
    
  3. save it (ctrl + s)

  4. after that, go back to xampp control panel and click again its config

  5. choose "Apache (httpd-ssl.conf)" find this code below and change it again:

    # Note: Configurations that use IPv6 but not IPv4-mapped addresses need two
    #       Listen directives: "Listen [::]:443" and "Listen 0.0.0.0:443"
    #
    #Listen 0.0.0.0:443
    #Listen [::]:443
    Listen 443
    
  6. save it (ctrl + s)

  7. then, click the "config" (note: above the netstat) and click the "service and port settings" then save both of it.

  8. finally, go to the "control panel" -> "Programs & Features" -> "Turn Windows On or Off".

  9. Uncheck your "Internet Information Services" then click ok.

Just wait for it and your computer/laptop will be automatically restart and try to open again your xampp control panel then start your Apache.


Just change the port 80 to anything else like 8080(in httpd.conf), and port 443 to something else like 4433 (in httpd-ssl.conf)


Examples related to php

I am receiving warning in Facebook Application using PHP SDK Pass PDO prepared statement to variables Parse error: syntax error, unexpected [ Preg_match backtrack error Removing "http://" from a string How do I hide the PHP explode delimiter from submitted form results? Problems with installation of Google App Engine SDK for php in OS X Laravel 4 with Sentry 2 add user to a group on Registration php & mysql query not echoing in html with tags? How do I show a message in the foreach loop?

Examples related to apache

Enable PHP Apache2 Switch php versions on commandline ubuntu 16.04 Laravel: PDOException: could not find driver How to deploy a React App on Apache web server Apache POI error loading XSSFWorkbook class How to enable directory listing in apache web server Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details How to enable php7 module in apache? java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient The program can't start because api-ms-win-crt-runtime-l1-1-0.dll is missing while starting Apache server on my computer

Examples related to xampp

Xampp localhost/dashboard phpMyAdmin ERROR: mysqli_real_connect(): (HY000/1045): Access denied for user 'pma'@'localhost' (using password: NO) Is there way to use two PHP versions in XAMPP? Where to find htdocs in XAMPP Mac phpMyAdmin access denied for user 'root'@'localhost' (using password: NO) How to downgrade php from 7.1.1 to 5.6 in xampp 7.1.1? How to turn on/off MySQL strict mode in localhost (xampp)? mysqli_connect(): (HY000/2002): No connection could be made because the target machine actively refused it How to install mcrypt extension in xampp Fatal error: Uncaught Error: Call to undefined function mysql_connect()

Examples related to port

Docker - Bind for 0.0.0.0:4000 failed: port is already allocated How do I kill the process currently using a port on localhost in Windows? Node.js Port 3000 already in use but it actually isn't? Can't connect to Postgresql on port 5432 Spring Boot - How to get the running port Make docker use IPv4 for port binding How to change the default port of mysql from 3306 to 3360 Open firewall port on CentOS 7 Unable to launch the IIS Express Web server, Failed to register URL, Access is denied XAMPP Port 80 in use by "Unable to open process" with PID 4