MySQL 如何让 XAMPP 控制面板正确安装和启动服务?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13605283/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 15:35:52  来源:igfitidea点击:

How can I get the XAMPP control panel to install & start services correctly?

mysqlapacheservicexampp

提问by OffLuffy

So recently every time I've tried to install Apache/MySQL/FileZilla as a service on XAMPP, it says something along the line of this:

所以最近每次我尝试在 XAMPP 上安装 Apache/MySQL/FileZilla 作为服务时,它都会说一些类似的内容:

5:20:18 AM  [Apache]    Apache Service detected with wrong path
5:20:18 AM  [Apache]    Change XAMPP Apache settings or
5:20:18 AM  [Apache]    Uninstall/disable the other service manually first
5:20:18 AM  [Apache]    Found Path: ERROR: Not Able To Open Service Manager
5:20:18 AM  [Apache]    Expected Path: "f:\xampp\apache\bin\httpd.exe" -k runservice
5:20:18 AM  [Apache]    Successful!

Afterwards, I can't start the process from the XAMPP panel until I uninstall the service from there and until then the Module name is highlighted red. Although if I leave them installed as a service (red name and all), I can go into the services manager and start them manually and they start fine, and even the XAMPP control panel turns them green and notices they run. This would probably happen for Tomcat as well, I just never use it so I haven't messed with it. All the paths seem to be correct (I do have it on the F drive), but even after countless reinstalls and registry wipe-downs, the XAMPP control does not seem to want to handle installing & running the service correctly. Getting a bit frustrated with this, so thanks in advance for any help.

之后,我无法从 XAMPP 面板启动该过程,直到我从那里卸载服务,然后模块名称以红色突出显示。虽然如果我将它们安装为服务(红色名称和所有),我可以进入服务管理器并手动启动它们并且它们启动良好,甚至 XAMPP 控制面板将它们变成绿色并通知它们运行。这也可能发生在 Tomcat 上,我只是从不使用它,所以我没有弄乱它。所有路径似乎都是正确的(我确实在 F 驱动器上有它),但即使经过无数次重新安装和注册表擦除,XAMPP 控件似乎也不想正确处理安装和运行服务。对此感到有些沮丧,因此在此先感谢您的帮助。

回答by Kamil

It's probably all about privileges, files ACL's etc.

这可能与权限、文件 ACL 等有关。

When you start XAMPP in normal mode (not as service) it starts with privileges of user who started it. This is probably your Windows account.

当您以正常模式(而不是作为服务)启动 XAMPP 时,它会以启动它的用户的权限启动。这可能是您的 Windows 帐户。

All files owned by your windows account are accessible for XAMPP. So if you create directory "F:\some_dir" it should be accessible for XAMPP in normal mode and there should be no problems, because XAMPP is using your account to access files.

XAMPP 可以访问您的 Windows 帐户拥有的所有文件。因此,如果您创建目录“F:\some_dir”,XAMPP 在正常模式下应该可以访问它,并且应该没有问题,因为 XAMPP 正在使用您的帐户访问文件。

When application is started as service - it uses another windows account(there are 2 accounts used by services by default: LOCAL SERVICE, NETWORK SERVICE). That account probably can't read and write files which belong to your personal windows account.

当应用程序作为服务启动时 - 它使用另一个 Windows 帐户(服务默认使用 2 个帐户:LOCAL SERVICE、NETWORK SERVICE)。该帐户可能无法读取和写入属于您的个人 Windows 帐户的文件

Account used for specyfic service can be changed.You can run services.msc, select service and go to properties and there should be "Login" tab.

可以更改用于特定服务的帐户。您可以运行 services.msc,选择服务并转到属性,应该有“登录”选项卡。

You can also change files/directory permissions and make it available for service account, but i think first solution is better.

您还可以更改文件/目录权限并使其可用于服务帐户,但我认为第一个解决方案更好。

Another issue with XAMPP is Control panel, that starts without administrative privileges by default, and it can't control any services, when you starting it from start menu. Some versions of XAMPP after installation will run XAMPP Control Panel with admin privileges, and it works fine until you close that app and start again (without admin privileges).

XAMPP 的另一个问题是控制面板,默认情况下它在没有管理权限的情况下启动,当您从开始菜单启动它时,它无法控制任何服务。安装后的某些版本的 XAMPP 将运行具有管理员权限的 XAMPP 控制面板,它可以正常工作,直到您关闭该应用程序并重新启动(没有管理员权限)。

If you trying to start XAMPP Control Panel and it doesnt ask about admin account - you have to right-click on XAMPP Control Panel icon and click "Run as administrator".

如果您尝试启动 XAMPP 控制面板并且它不询问管理员帐户 - 您必须右键单击 XAMPP 控制面板图标并单击“以管理员身份运行”。

回答by Mathlight

For the no acces on WAMP server, go to the httpd.conf of appache and then search for something like this:

对于 WAMP 服务器上的 no access,请转到 appache 的 httpd.conf,然后搜索如下内容:

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>

But it has then some other values by order and deny.... You must change it to the above to make it work.

但是它按顺序还有其他一些值并拒绝......您必须将其更改为上述内容才能使其工作。

Also do i have this in my httpd.conf, mayby you can use that to...:

我的httpd.conf中也有这个吗,也许你可以用它来...:

<Directory "D:/wamp_together/www/">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride all

    #
    # Controls who can get stuff from this server.
    #

#   onlineoffline tag - don't remove
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1

</Directory>