问题相关代码,请勿粘贴截图
我的php
<?php
$servername = "172.16.66.142";
$username = "zabbix";
$password = "root.2020";
// 创建连接
$conn = mysqli_connect($servername, $username, $password);
// 检测连接
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
echo "连接成功";
?>
我的数据库
show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| test |
| zabbix |
+--------------------+
3 rows in set (0.00 sec)
运行结果及报错内容
curl http://172.16.66.142 -I
HTTP/1.0 500 Internal Server Error
Date: Tue, 15 Mar 2022 16:54:07 GMT
Server: Apache/2.4.44 (KylinSecOS) PHP/5.4.16
X-Powered-By: PHP/5.4.16
Connection: close
Content-Type: text/html; charset=UTF-8