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 ...
随机推荐
- Net 4.5 WebSocket 在 Windows 7, Windows 8 and Server 2012上的比较以及问题
Net 4.5 WebSocket在Windows 8, Windows 10, Windows Server 2012可以,但是在Windows 7, 就会报错. 错误1.“一个文件正在被访问,当前 ...
- JS和Jquery获取和修改label的值的示例代码
abel标签在JS和Jquery中使用不能像其他标签一样用value获取它的值,下面有个不错的示例,希望大家可以学习下 来源: < JS和Jquery获取和修改label的值的示例代码 & ...
- oracle数据库内存调整之增加内存
注:本文来源:小颜Kevin <oracle数据库内存调整之增加内存> 模拟操作系统内存从2G增加为8G后,调整数据库内存参数,示例中参数不作为实际生产环境参考,因为因需所取,调整参数 ...
- Confluence 6 色彩选择器展开的页面
色彩选择器展开的页面中对色彩的选择配置. https://www.cwiki.us/display/CONFLUENCEWIKI/Customising+Colour+Schemes
- LoadRunner监控window系统各项指标详解
一.监控系统时,需要监控的项 System 系统 Processor 处理器 Memory 内存 PhysicalDisk 磁盘 Server 服务器 二.指标详解 (一). PhysicalDisk ...
- day14 迭代器 生成器 面向过程思想
"" 迭代器 什么是迭代器(iterator) 器指的某种工具, 迭代指的是更新换代的过程,例如应用程序的版本更新从1.0 变成 1.1 再1.2 迭代的目的是要根据上一个结果,产 ...
- laravel 不理解的call方法
返回结果: 原来是调用同控制器的这四个方法之一...vendor\zhiyicx\plus-question\src\API2\Controllers\UserQuestionController.p ...
- java和python对比----1:
对计算来说: java 除法: 3/4 ==0; pyhton 除法: 3/4 ==0 3//4==0.75
- 动手动脑——JAVA语法基础
EnumTest.java public class EnumTest { public static void main(String[] args) { Size s=Size.SMALL; Si ...
- Allegro PCB Design GXL (legacy) 由零散的对象构成一个Shape
Allegro PCB Design GXL (legacy) version 16.6-2015 从DXF文件中导入板框之后,发现板框是由Line Segment.Arc Segment等对象组成, ...