apache环境配置 | httpd Could not reliably determine the server's fully qualified domain name
apache环境配置 | httpd Could not reliably determine the server's fully qualified domain name
前言
作为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
参考资料
- php开启与关闭错误提示适用于没有修改php.ini的权限php技巧脚本之家
- 解决apache启动错误:Could not reliably determine the server’s fully qualified domain name - CSDN博客
联系作者
- CSDN博客:http://blog.csdn.net/u012104219
- 知乎专栏:https://zhuanlan.zhihu.com/frankfeekr
- Github:https://github.com/frank-lam
- Email:frank_lin@whu.edu.cn
如果你觉得不错的话,不妨打赏一下,这样我就有更大的动
apache环境配置 | httpd Could not reliably determine the server's fully qualified domain name的更多相关文章
- 测试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 ...
- 解决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- ...
- 源码安装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 ...
- 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 / ...
- 重启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 ...
- 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 ...
- 解决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 ...
- 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 ...
- 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 ...
随机推荐
- 开源巨献:年度最佳 JavaScript 和 CSS 开源库推荐!
作者:编辑部的故事 < 开源巨献:年度最佳 JavaScript 和 CSS 开源库推荐! > 开源巨献:年度最佳 JavaScript 和 CSS 开源库推荐! Tutoria ...
- Confluence 6 MySQL 3.x 字符集编码问题
MySQL 3.x is 已知在大写和小写转换的时候有些问题(non-ASCII). 问题诊断 请按照 Troubleshooting Character Encodings 页面中的内容对问题进行诊 ...
- Java 本周四、五的相关研究——Excel 的文件管理(数据库初步)
日期:2018.9.28 星期五 博客期:013 说到这里,就二话不多说了!这次研习的是与Excel表相关联的方法 1.导入jar包(需要自己下载) 2.AccountManager类的实现(关键看非 ...
- CentOS 7 安装 Redis
1.Redis 下载地址:https://redis.io/download 2.上传到服务器指定文件夹 ,我这边传到了根目录下 /mysoft 这个目录下 解压 tar -zxvf redis- ...
- burpsuite使用教程和实战详解(一)
1.最近做渗透测试,其实使用一种方式很难全面的对一个web或者app等安全服务器做安全评估,所以要尽可能的对网络安全的渗透测试有一个较全面的认知.不光要熟悉前端和 后天的编程,还有掌握基于这两种编程的 ...
- MySQL架构及SQL语句
MySQL基础: 单进程多线程: 用户连接:连接线程 官方组件架构: MySQL的数据文件类型: 数据文件.索引文件 重做日志.撤销日志.二进制日志.错误日志.查询日志.慢查询日志.中继日志 MySQ ...
- (转)webpack和webpack-simple区别(如何引入css文件)
博主最近研究vue+webpack的时候想引入css文件死活引入不出来,在webpack-simple那里却能引得出来,十分的纳闷,然后细心的调试了一下,原来这webpack和webpack-simp ...
- 繁简字转换(C#)
1.首先引入: using Microsoft.VisualBasic; 2.转换方法: //繁体转简体 public static string Traditional2Simplified(str ...
- Navicat Premium 12.1.8.0安装与激活
本文介绍Navicat Premium 12.1.8.0的安装.激活与基本使用. 博主所提供的激活文件理论支持Navicat Premium 12.0.x系列和Navicat Premium 12.1 ...
- 20165328 学习基础和C语言基础调查
一.技能学习经验: 1.你有什么技能比大多数人(超过90%以上)更好: 我算是一个普通人,没什么特别的才能,如果硬要说有什么技能比其他人较好的话,我想大概是快速阅读的能力吧,我能以很快的速度 ...