logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Can not restart Apache httpd as a Windows service
Author
bobfleming



Joined: 19 Dec 2016
Posts: 4
Location: USA, Seattle

PostPosted: Tue 27 Jun '17 22:34    Post subject: Can not restart Apache httpd as a Windows service Reply with quote

I stopped httpd as a service in order to do something to try get PHP to work, but now I am unable to restart httpd as a service. I am running Apache 2.4.23.0 on
Windows 7 Professional. I get the following error: Log Name: System
Source: Service Control Manager
Date: 6/27/2017 11:21:10 AM
Event ID: 7024
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Computer: boss
Description:
The Apache2.4 service terminated with service-specific error Incorrect function..
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Service Control Manager" Guid="{555908d1-a6d7-4695-8e1e-26931d2012f4}" EventSourceName="Service Control Manager" />
<EventID Qualifiers="49152">7024</EventID>
<Version>0</Version>
<Level>2</Level>
<Task>0</Task>
<Opcode>0</Opcode>
<Keywords>0x8080000000000000</Keywords>
<TimeCreated SystemTime="2017-06-27T18:21:10.030938300Z" />
<EventRecordID>469238</EventRecordID>
<Correlation />
<Execution ProcessID="600" ThreadID="1180" />
<Channel>System</Channel>
<Computer>boss</Computer>
<Security />
</System>
<EventData>
<Data Name="param1">Apache2.4</Data>
<Data Name="param2">%%1</Data>
</EventData>
</Event>

I had two different PHP directories, php and php-5.6.28. I have been unable to get PHP to work and suspected that the directory php was an older version interfering, so deleted it. Then when I could not restart the service I suspect that the php directory was required. I restored the directory and one file that was in it, but can not find the other one.
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3049
Location: Hilversum, NL, EU

PostPosted: Tue 27 Jun '17 23:16    Post subject: Reply with quote

To get more info:

Try to start in a command prompt, and go to the apache/bin and type:

>httpd -t
Back to top
mraddi



Joined: 27 Jun 2016
Posts: 149
Location: Schömberg, Baden-Württemberg, Germany

PostPosted: Tue 27 Jun '17 23:22    Post subject: Reply with quote

Have a look at the apache's log-files. In most cases there are helpful information what happened.

There is also the possibility to check if Apache finds some errors in the config file:

Of course you have to modify the command to match your enviroment and use the path that is valid for your computer Very Happy

Tested with an additional "X" in the path:
Code:
>"c:\Program Files\Apache Software Foundation\Apache 2.4\bin\httpd.exe" -t -f "c:\Program Files\Apache Software Foundation\Apache 2.4\conf\httpd.conf"
httpd.exe: Syntax error on line 574 of C:/Program Files/Apache Software Foundation/Apache 2.4/conf/httpd.conf: Cannot load c:/Program Files/php7X/php7apache2_4.dll into server: Das angegebene Modul wurde nicht gefunden.

Sorry for the german errormessage - in english it is something like "this module could not be found."

With a correct path the result is:
Code:
>"c:\Program Files\Apache Software Foundation\Apache 2.4\bin\httpd.exe" -t -f "c:\Program Files\Apache Software Foundation\Apache 2.4\conf\httpd.conf"
Syntax OK

After all errors are fixed and the Windows-Service still refuses to start you can try to start Apache on the CommandLine:
Code:
>"c:\Program Files\Apache Software Foundation\Apache 2.4\bin\httpd.exe" -X -f "c:\Program Files\Apache Software Foundation\Apache 2.4\conf\httpd.conf"

It will display error-messages directly so you can fix them...

Hope these hints help Question
Back to top
bobfleming



Joined: 19 Dec 2016
Posts: 4
Location: USA, Seattle

PostPosted: Wed 28 Jun '17 20:29    Post subject: Reply with quote

Thank you, Steffen, I followed your advice and resolved the problem. I had commented out the LoadModule line for php5 but had failed to comment out the nest line for PHPIniDir. Now I commented out that line and Apache loads as a service.
Back to top


Reply to topic   Topic: Can not restart Apache httpd as a Windows service View previous topic :: View next topic
Post new topic   Forum Index -> Apache