megamage
megamage

Reputation: 346

xampp apache 2.4.9 suddenly stopped working

Hi I installed xampp on windows 7 which is running in a virtual box machine my apache was working fine yesterday but suddenly it stopped working today. I viewed error logs but it shows only yesterday's logs today's log is not getting updated i couldn't find the exact error.

But when i start the apache in xampp control panel it shows the following error

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

i tried changing ports but getting the same error do know how to proceed please help me to solve this issue.Thanks in advance.

Note:This question has been already asked and i tried those solution but the same error exists.

Upvotes: 1

Views: 6127

Answers (1)

megamage
megamage

Reputation: 346

Hi i found the answer myself by digging out the issues in cmd i ran the command

netstat -a

It will display the ports that are being used in my case port 80 was not being used so the error was not because of port issue

If the problem is not a busy port you can also try the following: select "show debug information" in the XAMPP config panel. you will find this option in config panel enable this option and click save it will display the files that are being executed, like when starting Apache you'll be shown something like "Executing "c:\xampp\apache\bin\httpd.exe". If you run the same command in cmd prompt it will clearly display the error with file name and line number.

All you need to do is to find the respective file dig in the code and resolve it.Your problem will be solved.

In my case i had error in virtual host configuration change the file /xampp/apache/conf/extra/httpd-vhost.conf change line 27 to 34 from

##<VirtualHost *:80>
    ##ServerAdmin www.example.com@localhost
    ##DocumentRoot "C:/xampp/htdocs"
    ##ServerName www.example.com
    ##ServerAlias www.dummy-host.example.com
    ##ErrorLog "logs/dummy-host.example.com-error.log"
    ##CustomLog "logs/dummy-host.example.com-access.log" common
##</VirtualHost> 

to

<VirtualHost *:80>
    ServerAdmin admin@localhost
    DocumentRoot "C:/xampp/htdocs/snipe-it/public"
    ServerName localhost
    ##ServerAlias www.dummy-host.example.com
    ##ErrorLog "logs/dummy-host.example.com-error.log"
    ##CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>

and restarted my apache my problem was solved.

Upvotes: 4

Related Questions