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