欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

Installing service... [Apache] Service was NOT (un)installed!

见下面红色的部分文字

Ctrl+R > regedit                  (打开注册表,找到 apache 服务,然后删掉即可,是因为自己多次安装,出现残留)      

Then go to HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services      

其实下面的根本不需要再看了 



Asked 
Active 6 months ago    
Viewed 18k times
8

I've been trying to install php, apache, and mySQL in a working fashion for some time now. After attempting manually several times and hitting roadblocks, I ended up just trying to use Xampp.

However, upon startup, the program says:

2:18:39 PM  [main]  Running with Administrator rights - good!
2:18:39 PM  [main]  XAMPP Installation Directory: "c:\xampp\"
2:18:39 PM  [main]  Checking for prerequisites
2:18:39 PM  [main]  All prerequisites found
2:18:39 PM  [main]  Initializing Modules
2:18:39 PM  [Apache]    Apache Service detected with wrong path
2:18:39 PM  [Apache]    Change XAMPP Apache and Control Panel settings or
2:18:39 PM  [Apache]    Uninstall/disable the other service manually first
2:18:39 PM  [Apache]    Found Path: "C:\Apache24\bin\httpd.exe" -k runservice
2:18:39 PM  [Apache]    Expected Path: "c:\xampp\apache\bin\httpd.exe" -k runservice
                   

I followed the suggestions here, but

(a) Changing the port Listen 80 to Listen *:80 or Listen 81 had no effect.

(b) using netstat -ao, there were no local addresses ending with 80.

I've also tried deleting any files related to apache, mysql, and php not in the xampp folder, which were left over from previous install attempts.

Tried xampp 1.8.2, uninstalled, tried 1.8.3, same issue.

For what I can guess, I must've changed some code somewhere outside Xampp before I installed it, and now it is executing when apache is run, changing the path from what Xampp wants (Expected Path: "c:\xampp\apache\bin\httpd.exe" -k runservice) to a path to the now deleted folder C:\Apache24\bin. However, I don"t know where this code might be!

I tried searching my whole C drive for C:\Apache24\bin, but the search came up empty.

Machine: Windows 7 64 bit

Previously installed/uninstalled: Apache2.2, Apache2.4, php5.5.4, MySQL using MySQL Installer 5.6

tried xampp for windows 1.8.2

xampp for windows 1.8.3 currently installed.

Any help?

                       
improve this question                                
edited May 23 '17 at 12:16                                
                                   
                               
Community                                    
11 silver badge                                    
asked Oct 1 '13 at 19:46                                
                               
user2836056
add a comment                
       

4 Answers

activeoldestvotes                    
       
21

The reason to get this error is because you had Apache installed once before and its service is still running.

If you are using windows 7, click on start and type "services". Open Services and see if Apache is listed. If yes, double click on it to see its properties. Copy the service name (e.g Apache 2.4) by selecting it -> right click -> selecting Copy.

Close the services window.

Click on start and find cmd by typing it. Right click on cmd.exe and select "Run as administrator".

When the cmd window has opened type this command and press Enter:

note: instead of Apache 2.4 you should right click on the window to select paste

sc delete "Apache 2.4"
                       

After pressing enter you should get the message: serviceDelete Success                        

Open services windows again (I explained it above) and see if you have Apache there again or not.

improve this answer                                
edited Dec 13 '18 at 10:06                                
                                   
                               
Aberrant                                    
2,7601 gold badge20 silver badges37 bronze badges                                    
answered Nov 17 '13 at 6:03                                
                                   
                               
add a comment                    
       
6

The above answer will probably provide you the solution, but in case it gives an error after you run the command:

sc delete "Apache 2.4"
                       

the error:

The specified service does not exist as an Installed service.
                       

You might want to change the "path to executable" for the Apache service manually. For that, open Registry Edit by using command prompt:

Ctrl+R > regedit

Then go to

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services
                       

and find the service for which you want to change the default path and then locate the ImagePathsubkey and change it's value to the Expected Path shown in XAMPP Control Panel.

improve this answer                                
answered Jan 30 '16 at 6:52                                
                                   
                               
add a comment                    
       
3                        
                   

Ctrl+R > regedit                        

Then go to HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services                        

for me it worked by deleting the apache service,                        

uninstall the apache. restart the windows                        

then just reinstall it to the former location it has conflict with.                        

now it works fine.                        

improve this answer                                
answered Feb 17 at 6:27                                
                                   
                               
add a comment                    
       
0

This error is not related to the port.

Inside the two links I explained exactly how this issue can be solved.


https://github.com/MHolger77/Xampp-WrongPath https://www.linkedin.com/pulse/xampp-wrongpath-mohammad-hosein-shamsaei/                        

Apache                        

  1. Apache Service detected with wrong path

  2. Change XAMPP Apache and Control Panel settings or

  3. Uninstall/disable the other service manually first

  4. Found Path: "somePath(wrongPath)" -k runservice

  5. Expected Path: "anotherPath(correctPath)" -k runservice

Follow the steps below:                        

  1. Press WinKey + R

  2. Run regedit

  3. go to "Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\"

  4. Find Apache file (example Apache2.4)

  5. Open Apache file

  6. Open ImagePath

  7. Replace the correctPath with the wrongPath

improve this answer                                
edited Mar 17 at 5:12                                
                                   
                               
J'e                                    
65611 silver badges24 bronze badges                                    
answered Mar 17 at 3:03                                
                                   
                               
add a comment                    
       

来自 https://stackoverflow.com/questions/19124599/trouble-with-apache-in-xampp-after-multiple-apache-installs            


           

多个Apache安装后,在Xampp中出现Apache故障                

问问题                
 
活动 6个月前                
观看了 18k次                
                       
8                                

我一直在尝试以一种可行的方式安装php,apache和mySQL。在几次手动尝试并遇到障碍之后,我最终只是尝试使用Xampp。                                

但是,启动后,程序将显示:                                

2:18:39 PM  [main]  Running with Administrator rights - good!
2:18:39 PM  [main]  XAMPP Installation Directory: "c:\xampp\"
2:18:39 PM  [main]  Checking for prerequisites
2:18:39 PM  [main]  All prerequisites found
2:18:39 PM  [main]  Initializing Modules
2:18:39 PM  [Apache]    Apache Service detected with wrong path
2:18:39 PM  [Apache]    Change XAMPP Apache and Control Panel settings or
2:18:39 PM  [Apache]    Uninstall/disable the other service manually first
2:18:39 PM  [Apache]    Found Path: "C:\Apache24\bin\httpd.exe" -k runservice
2:18:39 PM  [Apache]    Expected Path: "c:\xampp\apache\bin\httpd.exe" -k runservice
                               

我遵循了这里的建议,但是                                

(a)改变该端口Listen 80Listen *:80Listen 81没有影响。                                

(b)使用netstat -ao,没有以80结尾的本地地址。                                

我还尝试删除xampp文件夹中未包含的与apache,mysql和php相关的所有文件,这些文件是先前安装尝试中遗留下来的。                                

尝试了xampp 1.8.2,已卸载,尝试了1.8.3,相同的问题。                                

我可以猜测,在安装Xampp之前,我必须在Xampp外部的某些地方进行了更改,并且现在它在apache运行时正在执行,将Xampp所需的路径(Expected Path: "c:\xampp\apache\bin\httpd.exe" -k runservice)更改为现在已删除的文件夹的路径C:\Apache24\bin但是,我不知道此代码可能在哪里!                                

我尝试在整个C驱动器中搜索C:\ Apache24 \ bin,但是搜索为空。                                

机器:Windows 7 64位                                

先前已安装/未安装:Apache2.2,Apache2.4,php5.5.4,使用MySQL Installer 5.6的MySQL                                

尝试用于Windows 1.8.2的Xampp                                

当前安装的Windows 1.8.3的xampp。                                

有什么帮助吗?                                

                                   
改善这个问题                                            
17年5月23日于12:16编辑                                            
                                               
                                           
社区                                                
1个1银徽章                                                
13年10月1日在19:46 问                                            
                                           
用户名                                            
添加评论                            
                   

4个答案                            

活跃的最古老的选票                                
                   
21                                    

出现此错误的原因是因为您以前安装过Apache并且其服务仍在运行。                                    

如果您使用的是Windows 7,请单击“开始”,然后键入“服务”。打开服务,然后查看是否列出了Apache。如果是,请双击它以查看其属性。通过选择服务名称(例如Apache 2.4)来复制它->右键单击->选择复制。                                    

关闭服务窗口。                                    

单击开始并cmd通过键入查找右键单击cmd.exe,然后选择“以管理员身份运行”。                                    

打开cmd窗口后,键入以下命令,然后按Enter:                                    

注意:您应该右键单击窗口以选择粘贴,而不是Apache 2.4。                                    

sc delete "Apache 2.4"
                                   

按回车键后,您应该会收到以下消息: serviceDelete Success                                    

再次打开服务窗口(我已经在上面解释了),看看您是否再有Apache。                                    

改善这个答案                                            
18年12月13日于10:06编辑                                            
                                               
                                           
异常                                                
2,7601金徽章20银徽章37枚青铜徽章                                                
13年11月17日在6:03 回答                                            
                                               
                                           
添加评论                                
                   
6                                    

上面的答案可能会为您提供解决方案,但如果在运行命令后出现错误,则可能会为您提供解决方案:                                    

sc delete "Apache 2.4"
                                   

错误:                                    

The specified service does not exist as an Installed service.
                                   

您可能想要手动更改Apache服务的“可执行文件路径”。为此,使用命令提示符打开“注册表编辑”:                                    

Ctrl + R>注册表编辑器                                    

然后去                                    

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services
                                   

并找到要更改其默认路径的服务,然后找到该ImagePath子项并将其值更改为Expected PathXAMPP控制面板中显示的值                                    

改善这个答案                                            
16年1月30日在6:52 回答                                            
                                               
                                           
添加评论                                
                   
3                                    

Ctrl + R>注册表编辑器                                    

然后转到HKEY_LOCAL_MACHINE \ System \ CurrentControlSet \ Services                                    

对我来说,它删除了apache服务,                                    

卸载apache。重新启动Windows                                    

然后将其重新安装到与之冲突的先前位置。                                    

现在工作正常。                                    

改善这个答案                                            
2月17日在6:27 回答                                            
                                               
                                           
添加评论                                
                   
0                                    

此错误与端口无关。                                    

在这两个链接中,我确切地解释了如何解决此问题。                                    


https://github.com/MHolger77/Xampp-WrongPath https://www.linkedin.com/pulse/xampp-wrongpath-mohammad-hosein-shamsaei/                                    

阿帕奇                                    

  1. 检测到Apache Service路径错误

  2. 更改XAMPP Apache和“控制面板”设置或

  3. 首先手动卸载/禁用其他服务

  4. 找到的路径:“ somePath(wrongPath)” -k runservice

  5. 预期路径:“ anotherPath(correctPath)” -k runservice

请按照以下步骤操作:                                    

  1. 按WinKey + R

  2. 运行regedit

  3. 转到“计算机\ HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \”

  4. 查找Apache文件(示例Apache2.4)

  5. 打开Apache文件

  6. 开启ImagePath

  7. 用错误的路径替换正确的路径

改善这个答案                                            
3月17日于5:12编辑                                            
                                               
                                           
                                               
65611银徽章24枚青铜徽章                                                
3月17日在3:03 回答                                            
                                               
                                           
添加评论                                
                   

你的答案                    

来自  https://stackoverflow.com/questions/19124599/trouble-with-apache-in-xampp-after-multiple-apache-installs                    


                   


           


           


           


           

Windows上的XAMPP-Apache无法启动            

问问题            
 
活跃 1年零6个月前            
观看了 134k次            
20                            

我已经在Windows 7计算机上安装了XAMPP,但无法使Apache工作。                            

在启动时,出现以下错误:                            

13:09:21  [apache]  Apache Service Detected With Wrong Path
13:09:21  [apache]  Uninstall the service manually first
13:09:21  [apache]  Possible problem detected! 
13:09:21  [apache]  Port 80 in use by "system"!
13:09:21  [tomcat]  Tomcat Service Detected With Wrong Path
13:09:21  [tomcat]  Uninstall the service manually first
                           

在打开XAMPP面板并安装Apache服务之后:我尝试启动它,它总是卡在“正在启动apache服务...”中。                            

关于如何解决这个问题有什么建议吗?                            

谢谢贾米尔                            

                             
改善这个问题                                        
12年8月3日在12:11编辑                                        
12年8月3日在11:28 问                                        
                                           
                                       
  • 3                                        
    您确定端口80上没有其他任何设备吗? –  smilledge '12 Aug 3'在11:29                                        
  • 另外,是否有可能在xampp之前在Windows上安装了Apache? –  Panos ' 2012年8月3日,11:33                                        
  • 转到开始> cmd,然后输入“ netstat -o”,并查看端口80是否繁忙。 –  URL87 ' 2012年8月3日,11:33                                        
  • 抱歉,我最初没有注意到一些有用的信息,我已经修改了我的帖子。奇怪的是,尽管我的帖子中显示了错误,但似乎并未通过Netstat使用端口80 –  Jamil,2012年 8月3日,12:14                                        
  • @Jamil; 检查它是否与IIS或SQL Server冲突(如果您以前曾使用过) –  URL87,2012年 8月3日,13:15                                        
再显示1条评论                        
               

9个答案                        

活跃的最古老的选票                            
               
62                                

我能够解决这个问题!                                

遇到与上述相同的问题,请确保没有任何东西在使用端口80,并且仍然无法正常工作,并得到消息,指出使用错误的路径检测到Apache和Mysql。                                

我确实曾经安装过XAMPP,然后将其卸载并重新安装。我什至手动卸载,但仍然有问题。                                

解决。确保先备份系统!                                

  1. 通过“控制面板”>“管理工具”(也带有Ctrl+Rservices.msc启动服务

  2. 寻找Apache和MySQL服务。查看描述中指示的补丁(右键单击服务,然后单击属性)。可能您列出了两次Apache,一次来自正确的安装,一次来自先前的安装。即使您只看到一个,也请查看路径,很可能是以前的安装导致您的安装无法进行。无论哪种情况,都需要删除这些不正确的服务。

    一种。转到命令提示符(以管理员身份运行):开始>所有程序>附件>右键单击命令提示符>选择“以管理员身份运行”                                        

    b。在命令提示符下键入sc delete service,其中service是要删除的服务,例如apache2.1(或sc delete Apache2.4)。它应该与您的服务中显示的完全一样。如果服务中有空格,例如Apache 2.1,则将其输入引号,即sc删除“ Apache 2.1”                                        

    C。按回车。现在刷新或关闭/打开您的服务窗口,您会发现它已经消失了。                                        

对于XAMPP发现以错误路径运行的所有服务,请执行此操作。                                

完成此操作后,继续并重新启动XAMPP控制面板(以管理员身份),瞧!所有作品。没有冲突                                

改善这个答案                                        
18年3月13日在19:58编辑                                        
                                           
                                       
拉姆·加迪亚拉姆                                            
21.7千9金徽章64银徽章88枚青铜徽章                                            
2012年8月22日在18:14 回答                                        
                                           
                                       
  • 太棒了。谢谢。总之,我们需要使用sc命令从服务中删除以前的apache服务:sc delete Apache2.4 –  ivkremer 2013年 2月13日,9:16                                            
  • 就我而言,该Apache服务已被禁用。谢谢。 –  Sumit Gera 13年2月24日在12:33                                            
  • 非常感谢!我尝试了几次,但所需要做的只是以管理员身份启动XAMPP和CMD,如果我从一开始就以XAMPP作为管理员运行,我敢保证这个问题永远不会发生。 –  诺文,2013年 4月9日,下午4:31                                             
  • 我也已经安装并重新安装了,但是不幸的是没有列出Apache服务……有人知道为什么吗? – Zyoo 13年  7月24日在10:39                                            
  • 1个                                            
    谢谢!问题解决了!很棒的帖子! –  Eyal Sooliman 16年3月18日在19:09                                            
再显示4条评论                            
               
10                                

我的朋友,这将解决您的问题;)                                

在文件夹(xampp)的根目录中,只需运行此文件(setup_xampp.bat),然后按Enter                                

并尝试启动apache服务器                                

每件事都会像魅力一样起作用;)                                

改善这个答案                                        
12年12月22日在1:03 回答                                        
                                           
                                       
  • 你应该得到更多的支持!!!经历了非常糟糕的一天之后,由于有了这个.bat文件,我可以使其运行顺利。太感谢了!! –  乔纳斯(Jonas) '16 Aug 25'9:54                                            
  • 它确实有效。谢谢 – 福雷斯特 17年  3月16日在1:50                                            
  • 节省了我太多时间!谢谢 – LaziTurtle 17年  8月10日在22:05                                            
  • 我发现这里的错误是什么! –  Reejesh PK 18年11月27日在10:26                                            
添加评论                            
               
3                                

最可能的原因是其他端口正在使用端口80。(通常可以是Skype,IIS等)。                                

本教程显示了如何在XAMPP中更改Apache端口                                

改善这个答案                                        
12年8月3日在11:34 回答                                        
                                           
                                       
添加评论                            
               
3                                

我花了3个多小时来找出解决方案。实际上,“系统”服务正在使用端口80,因此我尝试将“ httpd”文件中的端口从80更改为8080,但同样出现了“系统使用端口80”的问题。它使我发狂了3个小时,因为每件事都发生了变化,例如端口,本地主机服务器等都指向8080。                                

最后,我发现了服务器根错误。基本上,“ httpd”中的“服务器根目录”应指向xampp的apache foler。就我而言,那是                                

ServerRoot "xampp/apache"
                               

我只是将其更改如下:                                

ServerRoot "C:/xampp/apache" 
                               

它已经成功运行,现在一切都以OK状态运行。                                

改善这个答案                                        
14年3月4日在8:49编辑                                        
                                           
                                       
Codemania                                            
1,0531金徽章9银徽章21枚青铜徽章                                            
14年3月4日在8:29 回答                                        
                                           
                                       
添加评论                            
               
2                                

请参阅:-http : //www.sitepoint.com/unblock-port-80-on-windows-run-apache/                                

并启用telnet http://social.technet.microsoft.com/wiki/contents/articles/910.windows-7-enabling-telnet-client.aspx                                

改善这个答案                                        
14年4月8日在6:18 回答                                        
                                           
                                       
  • 不要复制粘贴链接作为答案。随着时间的推移,链接可能会出错。 –  Gabriel.Massana 2014年 4月8日在6:37                                            
添加评论                            
               
1个                                

XAMPP v3.2.1安装后,我遇到了相同的问题。我没有大多数人认为的Skype,但是作为软件开发人员,我认为我的其他应用程序已在使用端口80。因此,我只需使用XAMPP控制面板即可更改它: 在此处输入图片说明                                

单击与APACHE服务相对应的“配置”按钮,然后选择第一个选项“ Apache(httpd.conf)”。在打开的文档中(使用任何文本编辑器-MS Word!除外),找到文本:                                

听12.34.56.78:80                                    

听80                                    

并将其更改为:                                

听12.34.56.78:83                                    

听83                                    

这可以是任何未使用的端口号。谢谢。                                

改善这个答案                                        
15年9月30日在13:03 回答                                        
                                           
                                       
添加评论                            
               
0                                

我知道这有点老了,但以防万一将来有人读过……                                

我卸载了xampp,删除了c:\ xampp文件夹下的所有内容,然后以管理员身份重新安装了xampp,它的工作原理很吸引人。                                

改善这个答案                                        
13年6月2日在18:19 回答                                        
                                           
                                       
添加评论                            
               
0                                

对我来说,问题是我安装了两个Apache Tomcat                                

以下步骤解决了我的问题:                                

  1. 在命令提示符下打开services.msc

  2. 选择Apache Tomcat服务,右键单击并选择属性

  3. 检查服务可执行文件的路径

  4. 请按照https://stackoverflow.com/questions/7190480/modifying-the-path-to-executable-of-a-windows-service中的说明 将路径更改为“ \ tomcat \ bin \ tomcat7.exe” // RS // Tomcat7

  5. 重新启动XAMPP控制面板

改善这个答案                                        
17年5月23日于12:10编辑                                        
                                           
                                       
社区                                            
1个1银徽章                                            
14年2月26日在19:00 回答                                        
                                           
                                       
添加评论                            
               
0                                

我的Apache服务与MySQL的启动不同。如果以上提示均无效,请按照以下步骤操作:                                

  1. 在任何可用的窗口上打开regedit.exe。以管理员身份运行。(仅在Windows 7和更高版本上)

    1. 转到本地机器/系统/ controlset001 /服务

    2. 查找和删除服务apache和mysql的文件夹。

    3. 卸载xampp。删除xampp的文件夹。

    4. 重新启动计算机,然后重新安装Xampp。之后,您的Xampp Apache和Mysql应该可以工作了。


Note: Ports 80 and 443 must be unused by any program. 
      If it is in use . Just edit ports. There is a lot of tutorials about that .
                           
改善这个答案                                        
15年1月10日于5:08编辑                                        
15年1月10日在5:02 回答                                        
                                           
                                       
添加评论                            

Robert Longson 保护2015年5月30日14:50                    

感谢您对这个问题的关注。因为它吸引了必须删除的低质量或垃圾邮件答案,所以现在发布答案需要在该站点上拥有10个声誉关联奖励不计入)。 

您是否要回答这些未解决的问题之一                    

不是您要找的答案?浏览标记为 其他问题 或提出您自己的问题                

来自  https://stackoverflow.com/questions/11794829/xampp-on-windows-apache-not-starting                


       


普通分类: