无法可靠地确定服务器的 MacBook 完全限定域名 [英] Could not reliably determine the server's fully qualified domain name for MacBook

查看:38
本文介绍了无法可靠地确定服务器的 MacBook 完全限定域名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

第一次获得新的 MBP 2016.尝试设置 PHP、MySQL 和阿帕奇.使用命令启动Apache

sudo apachectl restart

然后通过

安装PHP

brew install php71 --with-httpd24

还做了以下更改...

<预><代码>## DirectoryIndex:设置 Apache 将在目录中提供的文件# 被请求.#DirectoryIndex index.html index.phpSetHandler 应用程序/x-httpd-php服务器名称开发服务器

此外,在主机文件 /etc/hosts/

中更新了相同的内容

但是,每当我尝试使用命令 sudo apachectl restartsudo apachectl stop 停止/重新启动我的 apache 时,我都会遇到以下错误.

AH00557: httpd: apr_sockaddr_info_get() 对于 Sureshs-MacBook-Pro.local 失败AH00558:httpd:无法可靠地确定服务器的完全限定域名,使用 127.0.0.1.全局设置ServerName"指令以抑制此消息httpd 未运行,正在尝试启动

但是,奇怪的是,当我从浏览器 http://localhost/index.php 执行任何 PHP 文件时,它运行良好.就像在我的 index.php 文件中一样,我使用的是代码 <?php phpinfo();?> 显示 PHP 版本 PHP Version 7.1.4 已加载.

尝试了很多,但不知道哪里出了问题.

---更新---

在我的 /private/etc/hosts 文件中更新 127.0.0.1 Sureshs-MacBook-Pro.local 后,解决了一个错误.现在我只有一个以下错误.

AH00558:httpd:无法可靠地确定服务器的完全限定域名,使用 Sureshs-MacBook-Pro.local.全局设置ServerName"指令以抑制此消息

解决方案

最后,我通过更新文件 /usr/local/etc/apache2/2.4 上的 ServerName localhost:8080 解决了这个问题/httpd.conf.这是一个不同的 httpd.conf 文件,我不知道它.

此外,对于 Apache start/restart/stop,以下命令 sudo/usr/sbin/apachectl start 对我有用.

First time got a new MBP 2016. Trying to setup PHP,MySQL & Apache. Started Apache by using command

sudo apachectl restart

Then installed PHP by

brew install php71 --with-httpd24

Also did following changes...

#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#

DirectoryIndex index.html index.php
SetHandler application/x-httpd-php

ServerName dev-server

Also, updated the same in host file /etc/hosts/

But, whenever I'm trying to Stop/Restart my apache by using command sudo apachectl restart or sudo apachectl stop I'm getting following errors.

AH00557: httpd: apr_sockaddr_info_get() failed for Sureshs-MacBook-Pro.local
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
httpd not running, trying to start

But, strangely when I'm executing any PHP file from my browser http://localhost/index.php it's working fine. As in my index.php file I'm using code <?php phpinfo(); ?> It's showing PHP version PHP Version 7.1.4 loaded.

Tried a lot but no clude what's going wrong at where.

---UPDATE---

After updating 127.0.0.1 Sureshs-MacBook-Pro.local in my /private/etc/hosts file, one error solved. Now I'm getting only one below error.

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using Sureshs-MacBook-Pro.local. Set the 'ServerName' directive globally to suppress this message

解决方案

Finally, I solved this by updating ServerName localhost:8080 on file /usr/local/etc/apache2/2.4/httpd.conf. It was a differnt httpd.conf file which I didn't knew about it.

Also, for Apache start/restart/stop following command sudo /usr/sbin/apachectl start works for me.

这篇关于无法可靠地确定服务器的 MacBook 完全限定域名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆