PHP问题处理集锦
环境Window10中 php压缩包版、apache压缩包版 、mysql.压缩包版或运行安装版。
问题1:
在cmdzhong 用httpd -t 检查,提示:
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::4de2:6c46:aec1:6a57. Set the 'ServerName' directive globally to suppress this message
Syntax OK
用httpd -k install安装服务,提示:
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::4de2:6c46:aec1:6a57. Set the 'ServerName' directive globally to suppress this message

处理:
在httpd.conf中,搜索
#ServerName www.example.com:80
在其后加一句:
ServerName localhost:80
再重新启动apache 服务即可
问题2:PHP版本和Apache版本的选择有时很关键,这是困惑我许久的一个情况:apache服务器能正常启用,php代码也能正常运行,MySQL也可使用,但是php代码无法正常连接操作MySQL数据库。
用phpinfo()函数测试,显示如下图:

这时,要考虑PHP版本和Apache版本组合是否不恰当,更换成熟的版本组合试试,如:https://download.csdn.net/download/cnds123/12270209
本文解决了在Windows 10环境下,Apache服务器启动时出现的域名确定错误,并提供了修改httpd.conf文件的具体步骤。同时,探讨了PHP版本与Apache版本不匹配导致无法正常操作MySQL数据库的问题,建议尝试更换成熟版本组合。
1663

被折叠的 条评论
为什么被折叠?



