apache环境配置 | httpd Could not reliably determine the server's fully qualified domain name

 
 转 https://blog.csdn.net/u012104219/article/details/79853797

前言

作为php开发者,你是否遇到这种情况。经常我们会在Linux系统上通过php do.php命令进行程序调试。有时候明明通过命令行方式调试程序成功后,却发现在浏览器请求我们的www.test.com/../do.php却不能够成功执行,报500错误。

这时候执行service httpd restart重启web服务

启动apache遇到错误:“Starting httpd: httpd Could not reliably determine the server’s fully qualified domain name, using localhost.localdomain for ServerName”。 
其实浏览器出现500错误,意味着你没有配置服务可依靠的域名,无需改动你的程序,只要修改配置文件即可。

哎,第一次遇到这个问题,最近还是用的VPN连上服务器,还一直以为是网络的问题,晕死了。。。好难过,不过还好解决了,特别记录这篇博文以便备忘和学习。

正确解决的步骤

1.打开你的httpd.conf配置文件(我的环境环境:vi /etc/httpd/conf/httpd.conf),如果不知道httpd.conf文件在哪里,可以通过打印phpinfo()函数来查看,或者cd /之后通过’locate php.ini’命令进行查找定位。

2.编辑httpd.conf文件,搜索”#ServerName”,添加ServerName localhost:80

[root@server conf]# ls
extra httpd.conf magic mime.types original
[root@server conf]# vi httpd.conf
#ServerName www.example.com:80
ServerName localhost:80
  • 1
  • 2
  • 3
  • 4
  • 5

3.重启服务service httpd restart提示如下两个OK则配置成成功。

Stopping httpd: [  OK  ]
Starting httpd: [ OK ]
  • 1
  • 2

4.在浏览器打开你的网页,即可成功运行。

5.php如何开启报错提醒? 
* 修改php.ini文件,display_errors = Off修改为display_errors = On

参考资料

联系作者

如果你觉得不错的话,不妨打赏一下,这样我就有更大的动

apache环境配置 | httpd Could not reliably determine the server's fully qualified domain name的更多相关文章

  1. 测试Apache服务器及httpd: Could not reliably determine the server's fully qualified domain name解决办法

    测试Apache服务器: 重启apache: sudo /usr/local/apache/bin/apachectl restart 若出现错误: httpd: Could not reliably ...

  2. 解决Apache启动错误:httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

    启动apache遇到提示: [root@bqh-119 conf]# ../bin/apachectl -thttpd: apr_sockaddr_info_get() failed for bqh- ...

  3. 源码安装Apache,报错:Cannot use an external APR with the bundled APR-util和httpd: Could not reliably determine the server's fully qualified domain name, using

    一.解决APR和APR-util错误: 1.1.安装APR: [root@ganglia httpd-2.2.23]# cd srclib/apr [root@ganglia apr]# ./conf ...

  4. apache状态显示报错AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdo...is message

    今天启动apache查看状态发现报错,说不能确认服务器完全确认域名,以下是报错内容: [root@localhost ~]# service httpd status Redirecting to / ...

  5. 重启Apache报错apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName ... waiting的解决方法

    启动apache提示 : apache2: Could not reliably determine the server's fully qualified domain name, using 1 ...

  6. Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name

    启动apache的时候,报告以下消息提示: Starting httpd: httpd: Could not reliably determine the server's fully qualifi ...

  7. 解决apache启动错误:Could not reliably determine the server's fully qualified domain name

    启动apache遇到错误:httpd: Could not reliably determine the server's fully qualified domain name [root@serv ...

  8. apache启动错误:Could not reliably determine the server's fully qualified domain name

    启动apache遇到错误:httpd: Could not reliably determine the server's fully qualified domain name [root@serv ...

  9. Starting httpd:Could not reliably determine the server's fully qualified domain name

    #service httpd start #Starting httpd: httpd: Could not reliably determine the server's fully qualifi ...

随机推荐

  1. C# 中使用 Excel

    using System;using System.Collections.Generic;using System.Text;using System.Reflection;using System ...

  2. Confluence 6 管理协同编辑 - 审计的考虑

    我们知道一些客户对审计是主要考虑的方面.我们不能保证在协同编辑的时候具有审计,审查功能.所有页面的修改当前附加到用户发布页面的属性中而不是用户的特定修改. 如果这个对你来说是一个问题的话,我们建议你在 ...

  3. 为 Confluence 6 分发包设置一个邮件会话

    最简单设置 Confluence 电子邮件发服务器的方否认就是通过 Confluence 的管理员控制台进行设置.请参考 Configuring a Server for Outgoing Mail ...

  4. 在 Confluence 6 中禁用 workbox 应用通知

    如果你选择 不提供应用通知(does not provide in-app notifications): Confluence workbox 图标将不会可见同时用户也不能在这个服务器上访问 wor ...

  5. 《剑指offer》栈的插入弹出序列

    本题来自<剑指offer> 栈的插入弹出序列 题目: 输入两个整数序列,第一个序列表示栈的压入顺序,请判断第二个序列是否可能为该栈的弹出顺序.假设压入栈的所有数字均不相等.例如序列1,2, ...

  6. WEB漏洞 XSS(一)

    1.xss的形成原理 xss 中文名是“跨站脚本攻击”,英文名“Cross Site Scripting”.xss也是一种注入攻击,当web应用对用户输入过滤不严格,攻击者写入恶意的脚本代码(HTML ...

  7. java常用的中间件

    tomcatWeblogicJBOSSColdfusionWebsphereGlassFish 一般本地开发的话建议使用tomcat. linux系统建议使用jetty或apache hpptd 大型 ...

  8. 滴水穿石-07Java开发中常见的错误

    1:使用工具Eclipse 1.1 "语法错误" 仅当源级别为 1.5 时已参数化的类型才可用 设置eclipse,窗口—>java—>编译器—>JDK一致性调到 ...

  9. Spring Boot配置大全

    Spring Boot项目使用一个全局的配置文件application.properties或者是application.yml,在resources目录下或者类路径下的/config下,一般我们放到 ...

  10. 关于64位 MS SQL 导入导出 Oracle 引发 ORA-06413 的解决方法

    如果在X64系统下我们想利用 MS SQL 的DTS导入导出 Oracle 数据,由 oracle 不支持路径中包含")",会引发 ORA-06413:连接未打开错误 解决的办法很 ...