简体   繁体   中英

Apache/xampp command line start error: AH00436: No installed service named "Apache2.4"

I installed Apache server on Windows 7 Pro with Xampp distribution. Apache starts fine from the XAMPP Control Panel, but I want to be able to control it from a command prompt. When I try to start it from the command prompt, I am getting the following error:

C:\\>httpd -k start [Fri Jun 14 13:21:59.055815 2013] [mpm_winnt:error] [pid 6344:tid 144] (OS 2)The system cannot find the file specified. : AH00436: No installed service named "Apache2.4".

I tried to change the Listen port in httpd.conf. It does not change anything. Any clues ?

Thanks.

I had absolutely the same problem with the "AH00436: No installed service named “Apache2.4”" after I downloaded Apache 2.4 for Windows and tried to start it the first time.

The solution was very very simple. You get the error message when you manually try to start the webserver by "httpd -k start", but no service was defined yet.

just do a "httpd -k install" and the windows service is added to the registry. after that, the "httpd -k start" works without error message.

I have just got a similar error message when running the same command, but in my case I had just installed wamp from http://www.wampserver.com/en/

C:\\wampserver\\bin\\apache\\apache2.4.9\\bin>httpd -k start [Mon Sep 29 14:27:05.203039 2014] [mpm_winnt:error] [pid 10720:tid 424] (OS 2)The system cannot find the file specified. : AH00436: No installed service named "Apache2.4".

I found that when I used the "-n" switch in the command line to include the name of the Apache web server service then it would work.

C:\\wampserver\\bin\\apache\\apache2.4.9\\bin>httpd -n wampapache64 -k start

So it seems to me that unless the name of the service is included using the "-n" switch in the command line it is assumed that the name of the service to start is "Apache2.4". In my case I did not have a service called Apache2.4, so the command failed. I do have a service called wampapache64 though, so when I specified that service name in the command line it ran without error.

I resolved the problem by installing the apache service. For apache, when i went to Apache -> Service, i couldn't even start the service, because those lines were disabled... so i installed the service, the line below the horizontal rule line.

Apparently, my apache didn't have allowed access on my computer... (That's when a window popped-up after installing the service asking to "Allow access" for apache on the computer)

Hope this helps.

I'm using wamp, not xampp.我使用的是 wamp,而不是 xampp。

Here is the solution for your above Error:

Please change the ServerRoot and DocumentRoot directives in httpd.conf file from default path (c:\\Apache24) to the zip installation path (current apache24 zip extraction path)

ServerRoot "D:\\httpd-2.4.4-win32\\Apache24"

DocumentRoot "D:\\httpd-2.4.4-win32\\Apache24\\htdocs"

After that restart the server and try to open the default page http://example.com : Please let me know your status on this

Thanks, Amarnath Polu & Bhaskar

I had the same problem and resolved it in two steps:

  • First of all, be sure that Apache 2.4 is installed as a service. You can do this by executing Xampp Control Panel as Administrator and clicking the icon in "service" column.

  • By default, Apache uses 2 ports: 80 and 443. You must be sure these ports are free. In my case, I had in use 443 port (SSL). You can change this by modifiying the Listen port in "conf/httpd.conf" (for standard port) and "conf/extra/httpd-ssl.conf" (for SSL port).

Good Luck! Greetings.

If you have Skype installed, make sure it uses "alternate ports" as it will take up port 80. If you quit Skype and try to start Wamp, it might work. This was my issue when trying to manually start the httpd-service and getting this error.

The same problem happened to me. When I check using httpd.exe -e warn it showed the error.

Only one usage of each socket address (protocol/network address/port) is normally permitted : AH00072: make_sock: could not bind to address [::]:80

Only one usage of each socket address (protocol/network address/port) is normally permitted : AH00072: make_sock: could not bind to address 0.0.0.0:80

So the error in my case was multiple Listen entries along with Listen 80 in httpd.config . I just comment #Listen 80 and restart the service and problem is solved.

If you don't have VMware ou Skype , follow those steps :

1) in Xampp control panel -> config -> Apache(httpd.conf)

Listen 80

ServerName localhost:80

<Directory /> AllowOverride none Require all denied </Directory>

<Directory "C:/xampp/htdocs"> ... Require all granted </Directory>

<Files ".ht*"> Require all denied </Files>

<Directory "C:/xampp/cgi-bin"> AllowOverride All Options None Require all granted </Directory>

2) in Xampp control panel -> config -> Apache(httpd-ssl.conf)

Listen 443

<VirtualHost _default_:443>

ServerName localhost:443

3) in Xampp control panel -> config -> Apache(httpd-xampp.conf)

<Directory "C:/xampp/php"> AllowOverride None Options None **Require all denied** <Files "php-cgi.exe"> **Require all granted** </Files> </Directory>

<IfModule alias_module>

Alias /licenses "C:/xampp/licenses/"

<Directory "C:/xampp/licenses"> Options +Indexes <IfModule autoindex_color_module> DirectoryIndexTextColor "#000000" DirectoryIndexBGColor "#f8e8a0" DirectoryIndexLinkColor "#bb3902" DirectoryIndexVLinkColor "#bb3902" DirectoryIndexALinkColor "#bb3902" </IfModule> **Require all granted** ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var </Directory>

Alias /phpmyadmin "C:/xampp/phpMyAdmin/"

<Directory "C:/xampp/phpMyAdmin"> AllowOverride AuthConfig **Require all granted** ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var </Directory>

Alias /webalizer "C:/xampp/webalizer/"

<Directory "C:/xampp/webalizer"> <IfModule php7_module> <Files "webalizer.php"> php_admin_flag safe_mode off </Files> </IfModule> AllowOverride AuthConfig **Require all granted** ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var </Directory>

</IfModule>

4) Find cmd.exe and right click to select run as administrator

5) Type cd C:\\xampp\\apache\\bin (installation path for Xampp)

6) Type httpd -k install

7) Type httpd -k start

8) Start Apache

Solution was pretty straightforward, I had Apache for x86 and PHP for x64, when I reinstalled PHP for x86, this error vanished.

Don't mix Apache and PHP version for different platforms.

For this to work with XAMPP Apache needs to be run as a service.

  • Open XAMPP control panel (Make sure to "Run as administrator").
  • Stop Apache.
  • Click the red cross on the Service column of Apache (so that it becomes a green tick).
  • Start Apache.

在此处输入图片说明

Bonus:

When you do this Apache will start every time you start your PC. If you want to start it manually (as it was before), change Startup Type in service.msc (search bar -> Services) from Automatic to Manual .

在此处输入图片说明

Any action triggered by the option -k (they are called signals ), needs the Apache service to exist in Windows services list. Therefore, if you see this error message, there are only two possible causes:

Your Apache service does not exist

Then just create it with

httpd.exe -h install

Now you should be able to send the restart signal

httpd.exe -k restart

Your Apache service has a custom name

If the service exists, but has a custom name such as "My Awesome Apache Service", then you have to specify that name when you want to send it any signal.

So, if you have installed it with

httpd.exe -k install -n "My Awesome Apache Service"

you have to restart it with

httpd.exe -k restart -n "My Awesome Apache Service"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM