Linux 启动 httpd - 检索 pid 文件时出错(空)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10035505/
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-06 05:37:50  来源:igfitidea点击:

Starting httpd - Error retrieving pid file (null)

linuxfedoraapache

提问by user1316233

I manually compiled and installed httpdon Fedora. I am trying to start it for the first time:

httpd在 Fedora 上手动编译并安装。我第一次尝试启动它:

./apachectl start -d ../

and receive the following error:

并收到以下错误:

(20014)Internal error: Error retrieving pid file (null)
 Remove it before continuing if it is corrupted.

Any help would be appreciated!

任何帮助,将不胜感激!

回答by Andrew Tomazos

A pid file is a file that contains the process id of a daemon (either in the file body or the file name). It is used by a daemon to make sure only one version of it is running at one time. It does this by either checking for the pid files existence or using the flock feature of some os/filesystems to lock it.

pid 文件是一个包含守护进程进程 ID 的文件(在文件体或文件名中)。守护进程使用它来确保一次只运行一个版本。它通过检查 pid 文件是否存在或使用某些操作系统/文件系统的 flock 功能来锁定它来实现这一点。

The error indicates that it could not access the pid file, which would indicate to my a permissions error.

该错误表明它无法访问 pid 文件,这将向我表明权限错误。

回答by Johnny Friend

You need to remove the httpd.pidfile and restart apache or xampp to solve this issue. Following page explains the instructions to remove that file:

您需要删除httpd.pid文件并重新启动apache 或xampp 才能解决此问题。以下页面解释了删除该文件的说明:

Removing the httpd.pid file

删除 httpd.pid 文件

回答by Redy S

I face same problem in ubuntu, and I try to run this code. Try to run :

我在 ubuntu 中遇到了同样的问题,我尝试运行此代码。尝试运行:

sudo rm /opt/lampp/httpd.pid

then

然后

sudo /opt/lampp/lampp restart

回答by llioor

If you have (13)Permission denied:so just add "sudo " and then add your commend.

如果您有(13)Permission denied:,只需添加“sudo”,然后添加您的推荐。

回答by Ivan

I had this issue on termux. i did

我在 termux 上遇到过这个问题。我做了

su
find -iname httpd.pin

and then

进而

su
rm /sbin/.magisk/mirror/data/data/com.termux/files/usr/var/run/apache2/httpd.pid