Xampp Apache server won't start - "Error: Apache shutdown unexpectedly." - apache

I've searched far and wide on the internet for answers but with no success. I downloaded xampp a couple of months ago and everything has worked fine until recently. I noticed the problem when I was unable to access localhost so I went onto the xammp control panel and saw that apache was turned off. When I click start now every time I get this message -
13:41:55 [Apache] Error: Apache shutdown unexpectedly.
13:41:55 [Apache] This may be due to a blocked port, missing dependencies,
13:41:55 [Apache] improper privileges, a crash, or a shutdown by another method.
13:41:55 [Apache] Press the Logs button to view error logs and check
13:41:55 [Apache] the Windows Event Viewer for more clues
13:41:55 [Apache] If you need more help, copy and post this
13:41:55 [Apache] entire log window on the forums
A common answer to this seems to be to change the port from 80 to 8080 in the httpd.conf file and then changing it from 443 to 4433 in the httpd-ssl.conf file. I have already done this and still not working. When I check the apache error logs it says -
AH00020: Configuration Failed, exiting
It might be worth mentioning that I installed Wordpress on my local server a few days ago and maybe that might have something to do with it? I have tried everything from re-starting my computer to running a full virus scan and nothing seems to work.
I am using Windows 10, Apache version 2.4 and PHP 7.
I've now also tried typing in the command "httpd -t" in Shell and it returns "syntax OK". Also here is a sample from the apache error log -
PHP Warning: 'vcruntime140.dll' 14.0 is not compatible with this PHP build linked with 14.16 in Unknown on line 0
[Tue Jun 09 04:15:03.462661 2020] [:emerg] [pid 4160:tid 548] AH00020: Configuration Failed, exiting
[Tue Jun 09 12:54:30.209908 2020] [core:warn] [pid 4000:tid 684] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
PHP Warning: 'vcruntime140.dll' 14.0 is not compatible with this PHP build linked with 14.16 in Unknown on line 0
[Tue Jun 09 12:54:30.239019 2020] [:emerg] [pid 4000:tid 684] AH00020: Configuration Failed, exiting
Thanks for taking the time to read this and if anyone has any ideas it would be much appreciated.

Ok I've managed to solve the proplem.
For anyone who is having the same problem (apache won't start even if port 80 is available) this info could be useful.
When I looked through the apache error logs there were a number of errors but the particular error causing the problem was -
PHP Warning: 'vcruntime140.dll' 14.0 is not compatible with this PHP build linked with 14.16 in Unknown on line 0
If anyone else gets this error it can be solved by installing the "Visual Studio 2015, 2017 and 2019" runtime (x64: vc_redist.x64.exe). Here's the link to where you can download it.
https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads
After the download is finished, go into xampp folder and right click on xampp-control.exe, click "run as administrator" then you should be able to start apache with no problems.
Hope this will help anyone who winds up in the same situation as I did.

Do you have checked the log files?
Sometimes it helps to reboot your computer. And then start xampp again

Related

Xampp could not open log file sslkey.log

I have rune XAMPP in adminstrator mode, when I click "start" apache server. It returns this:
20:41:51 [Apache] Status change detected: stopped
20:41:51 [Apache] Error: Apache shutdown unexpectedly.
20:41:51 [Apache] This may be due to a blocked port, missing dependencies,
20:41:51 [Apache] improper privileges, a crash, or a shutdown by another method.
20:41:51 [Apache] Press the Logs button to view error logs and check
20:41:51 [Apache] the Windows Event Viewer for more clues
20:41:51 [Apache] If you need more help, copy and post this
20:41:51 [Apache] entire log window on the forums
I checked the error logs and it states this:
[Tue Feb 15 20:41:51.126535 2022] [ssl:notice] [pid 6152:tid 576] (OS 3)The system cannot find the path specified. : AH10226: Could not open log file 'C:\\Users\\Zen\\Desktop\\SSLKEY\\sslkey.log' configured via SSLKEYLOGFILE
AH00016: Configuration Failed
I have looked all over the internet and found nobody with the same issue. I have reinstalled XAMPP three times now, and restarted my PC each time.
I apologize if this is easy to solve, I am new to XAMPP and web development.
Thank you,
Zen
I figured it out. I have no idea why XAMPP, despite numerous reinstallations, was presuming that "C:\Users\Zen\Desktop\SSLKEY\sslkey.log" path existed.
But I simply created a folder on my desktop, and then created a file called sslkey.log (with nothing in it), and Apache now works.
Sorry it is a simple fix, I am brand new to web development.

MAMP Pro 5.0.3 SSL Failure

All sites work fine when SSL is not enabled. Once I enable it, it fails...
I installed MAMP Pro 5.0.3 today hoping that might change things. Tried SSL again, got a failure and this message from the log:
[Tue Aug 07 16:14:53 2018] [notice] Graceful restart requested, doing restart
(48)Address already in use: make_sock: could not bind to address 10.20.1.10:80
no listening sockets available, shutting down
Can anyone help me figure out what is going on here? (Oh, and how to fix it....) Thanks in advance...

Server certificate does NOT include an ID XAMPP

I'm trying to get Apache running on my system using XAMPP, every time I try to start it I get an error:
09:28:04 [Apache] Error: Apache shutdown unexpectedly.
09:28:04 [Apache] This may be due to a blocked port, missing dependencies,
09:28:04 [Apache] improper privileges, a crash, or a shutdown by another > method.
09:28:04 [Apache] Press the Logs button to view error logs and check
09:28:04 [Apache] the Windows Event Viewer for more clues
09:28:04 [Apache] If you need more help, copy and post this
09:28:04 [Apache] entire log window on the forums
I've then opened the error log and it seems like it keeps outputting:
[ssl:warn] [pid 8516:tid 704] AH01909: www.example.com:443:0 server ? certificate does NOT include an ID which matches the server name
I then tried to do a little more research on the error and I then discovered that it could be administration issues, so I then ran it as admin but still nothing. Not sure how to proceed with this issue, so I thought I'd ask for help from someone with a little more experience with Apache and XAMPP.
I've discovered that a fresh install of XAMPP resolved my error, and I can now run Apache with no errors.

Apache Server Won't Start in MAMP

Apache server won't start when in MAMP. Here are the error logs:
[Wed Aug 01 21:07:34 2012] [notice] Digest: generating secret for digest authentication ...
[Wed Aug 01 21:07:34 2012] [notice] Digest: done
[Wed Aug 01 21:07:34 2012] [notice] Apache/2.0.63 (Unix) PHP/5.3.2 DAV/2 configured -- resuming normal operations
[Wed Aug 01 21:08:00 2012] [notice] caught SIGTERM, shutting down
[Wed Aug 01 21:08:01 2012] [notice] Digest: generating secret for digest authentication ...
[Wed Aug 01 21:08:01 2012] [notice] Digest: done
[Wed Aug 01 21:08:01 2012] [notice] Apache/2.0.63 (Unix) PHP/5.3.2 DAV/2 configured -- resuming normal operations
[Wed Aug 01 21:08:51 2012] [notice] caught SIGTERM, shutting down
I don't think I did anything our of the ordinary except create a new folder in htdocs. Any suggestions?
My solution:
in /Applications/Mamp/Library/bin, find the file envvars and rename it to _envvars.
now it works.
I encountered this same issue with the same log output above, but did not need to reinstall MAMP to solve the issue in my case. When I encountered this error it was related to one of the hosts I had set up. Click the Hosts tab and see if any of your hosts appear in red:
The host in red required SSL certificates. In the configuration I did not have valid references to the required certificates after I had altered the file structure of my application. After fixing this issue and applying changes the host was no longer highlighted in red, and I was able to start Apache through MAMP.
Additionally, you can ensure that the problem doesn't have to do with your Apache client itself by running this command in terminal:
sudo /Applications/MAMP/Library/bin/apachectl restart
OR
sudo /Applications/MAMP\ PRO/Library/bin/apachectl restart
If you are able to start Apache in terminal, you have ruled out that you have an error with MAMP's Apache client itself.
Change the name of the file envvars to _envvars in /Applications/MAMP/Library/bin , thats it .
Instead of reinstalling mamp I did the following:
1. Moved back to default mamp ports
2. Started mamp
3. Stopped mamp
4. Went back to ports 80 443 3306
and it started working.
Just reinstalled MAMP and changed the ports. Not sure what the problem was, but it's fixed now.
If your existing MAMP PRO suddenly won't start Apache anymore, then it might be an error in vhosts settings which is not visible.
There is often no indication in apache_error.log - it just comes up with the message.
Apache wasn't able to start. Please check log for more information.
In my case it was a wrong path in Customized virtual host settings such as
Include /path/to/project/rewrite.conf
Vhost config is saved in ~/Library/Application Support/appsolute/MAMP PRO/httpd.conf so you can check the settings there.
Solution: MAMP 4 - Dec 2017, macOS High Sierra
Had this issue with MAMP Pro 3.4.1 so i paid for a new license so i could upgrade to Version 4.2.1 and the problem still occurred. I tried the above solution and unfortunately had no luck.
I did however get Apache running again by selection all options for the directory directive as shown in the image below:
This issue occurred completely randomly, one day everything working fine then the next... Apache says no. I believe the issue is that like web browsers use a Cache and separately also hold open processes, i think sometimes when MAMP or MAMP Pro is not closed properly then it can screw up Apache because it is not stopped correctly.
I hope this answer helps any persons experiencing this issue!
In case above answers didn't fix it, you can check that Document Root isn't set on some non-existing directory.
Go to MAMP Settings > Web-Server > Document Root
I found a Solution:
JUST:
in /Applications/Mamp/Library/bin, find the file envvars and rename it to _envvars.
this issue comes to me today …
after trying several solutions, i found this dialog message may appear if MAMP no longer finds a certificate used by a securized localhost.
So be careful to keep them in a place you won't move or delete.
hope it helps

Apache Server will not start on MAMP

Im still very new to this so please go easy on me. When i click on MAMP, the light for the apache will turn on, then turn off but the mysql will remain on and work. But the localhost wont work, displaying the error "localhost refused to connect."
I searched online and tried changing the port from 80 to the default 8888 but it still does not work. When i check the error logs on MAMP/logs/apache_error, and it displays
[warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[warn] pid file C:/MAMP/bin/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[notice] Digest: generating secret for digest authentication ...
[notice] Digest: done
Please help, im using windows 10, im a complete newbie
I had the same problem.
I've changed PHP standard version from 7.3.7 to 7.2.14 and restarted. it worked.