PHP网站无法链接数据库。

网站创建的类型式运行环境 [PHP_7_2],安装网站时需要填写服务器相关信息,数据库服务器原本是填写:127.0.0.1的但是连接不上,后面陆续换成“容器连接地址”“外部连接地址”或者直接复制两个地址的URL填写到“数据库服务器”上也还是连接失败。
后面我直接把sql数据导入到phpMyAdmin中,让后通过修改网站的confiq.php文件但还是连接不上数据库。


2
3

补充说明:
1Panel创建的PHP运行环境网站在甲骨文云VPS上无法连接数据库。
1Panel安装了phpMyAdmin通过用容器名称和root用户密码是能连接上phpMyAdmin的。
后面创建PHP网站将jizhiCMS上传安装后无法连接服务器,1Panel防火墙已开启3306端口,甲骨文云的安全规则也全部放行(图4)。但网站还是连接不上服务器,该VPS用的是甲骨文云ARM。
后面将CMS放到甲骨文云的AMD服务器上配置和ARM的一致却能连接上服务器。
AMD和ARM服务器都有做以下处理:

方法1:
停止firewall
systemctl stop firewalld.service
禁止firewall开机启动
systemctl disable firewalld.service
关闭iptables
service iptables stop
去掉iptables开机启动

chkconfig iptables off

关闭甲骨文自带的防火墙规则(这个是关键)
apt-get purge netfilter-persistent

修改为新的防火墙规则
apt-get install netfilter-persistent

然后重启
reboot


方法2:

推荐使用以下脚本:

关闭 firewalld

systemctl stop firewalld
systemctl disable firewalld

设置默认策略为 ACCEPT(避免锁死)

iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT

清空 iptables

iptables -F
iptables -X
iptables -Z

获取当前 SSH 端口

SSH_PORT=$(grep -E "^Port " /etc/ssh/sshd_config | awk ‘{print $2}’)

如果没有 Port 行,则默认 22

[ -z “$SSH_PORT” ] && SSH_PORT=22

放行当前 SSH 端口(最小 SSH 安全规则)

iptables -A INPUT -p tcp --dport $SSH_PORT -j ACCEPT

保存规则

netfilter-persistent save

然后重启

reboot

这两个方法是效果是一样的,ARM和AMD服务器都是用着一样的甲骨文云安全规则,并且ARM安装的1Panel防火墙还开启了3306端口,而AMD的却没有开启。ARM的网站无法连接服务器不知道是ARM的原因还是1Panel的原因亦或是CMS的原因?
后面问AI说是1Panel的Docker网络问题,将MySQL 改成 host 网络就可以了,但是我将Docker的MySQL网络改成host和bridge都不行,还是无法连接,并且数据库服务器改成localhost/127.0.0.1也都一样。
后续尝试用aaPanel(宝塔海外版)可以正常连接。

看一下 PHP 容器中有没有异常日志

以下是MySQL的日志:

2026-09-17 15:49:37+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.11-1.el9 started.
2026-09-17 15:49:37+00:00 [Note] [Entrypoint]: Switching to dedicated user ‘mysql’
2026-09-17 15:49:37+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.11-1.el9 started.
2026-09-17 15:49:37+00:00 [Note] [Entrypoint]: Initializing database files
2026-09-17T15:49:37.610716Z 0 [System] [MY-015017] [Server] MySQL Server Initialization - start.
2026-09-17T15:49:37.611964Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.4.11) initializing of server in progress as process 80
2026-09-17T15:49:37.620242Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2026-09-17T15:49:38.273018Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2026-09-17T15:49:40.158464Z 6 [Warning] [MY-010453] [Server] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
2026-09-17T15:49:42.275894Z 0 [System] [MY-015018] [Server] MySQL Server Initialization - end.
2026-09-17 15:49:42+00:00 [Note] [Entrypoint]: Database files initialized
2026-09-17 15:49:42+00:00 [Note] [Entrypoint]: Starting temporary server
2026-09-17T15:49:42.311822Z 0 [System] [MY-015015] [Server] MySQL Server - start.
2026-09-17T15:49:42.508848Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.4.11) starting as process 119
2026-09-17T15:49:42.525416Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2026-09-17T15:49:43.121459Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2026-09-17T15:49:43.521746Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2026-09-17T15:49:43.521787Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2026-09-17T15:49:43.526141Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location ‘/var/run/mysqld’ in the path is accessible to all OS users. Consider choosing a different directory.
2026-09-17T15:49:43.566617Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: /var/run/mysqld/mysqlx.sock
2026-09-17T15:49:43.566907Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: ‘8.4.11’ socket: ‘/var/run/mysqld/mysqld.sock’ port: 0 MySQL Community Server - GPL.
2026-09-17 15:49:43+00:00 [Note] [Entrypoint]: Temporary server started.
‘/var/lib/mysql/mysql.sock’ → ‘/var/run/mysqld/mysqld.sock’

2026-09-17 15:49:46+00:00 [Note] [Entrypoint]: Stopping temporary server
2026-09-17T15:49:46.373005Z 10 [System] [MY-013172] [Server] Received SHUTDOWN from user root. Shutting down mysqld (Version: 8.4.11).
2026-09-17T15:49:47.909862Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.4.11) MySQL Community Server - GPL.
2026-09-17T15:49:47.909890Z 0 [System] [MY-015016] [Server] MySQL Server - end.
2026-09-17 15:49:48+00:00 [Note] [Entrypoint]: Temporary server stopped

2026-09-17 15:49:48+00:00 [Note] [Entrypoint]: MySQL init process done. Ready for start up.

2026-09-17T15:49:48.391785Z 0 [System] [MY-015015] [Server] MySQL Server - start.
2026-09-17T15:49:48.587636Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.4.11) starting as process 1
2026-09-17T15:49:48.592922Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2026-09-17T15:49:49.181878Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2026-09-17T15:49:49.533917Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2026-09-17T15:49:49.533967Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2026-09-17T15:49:49.538090Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location ‘/var/run/mysqld’ in the path is accessible to all OS users. Consider choosing a different directory.
2026-09-17T15:49:49.593885Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: ‘8.4.11’ socket: ‘/var/run/mysqld/mysqld.sock’ port: 3306 MySQL Community Server - GPL.
2026-09-17T15:49:49.593902Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: ‘::’ port: 33060, socket: /var/run/mysqld/mysqlx.sock
2026-09-18T03:48:29.861717Z 0 [System] [MY-013172] [Server] Received SHUTDOWN from user . Shutting down mysqld (Version: 8.4.11).
2026-09-18T03:48:30.433925Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.4.11) MySQL Community Server - GPL.
2026-09-18T03:48:30.434172Z 0 [System] [MY-015016] [Server] MySQL Server - end.
2026-09-18 03:48:30+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.11-1.el9 started.
2026-09-18 03:48:31+00:00 [Note] [Entrypoint]: Switching to dedicated user ‘mysql’
2026-09-18 03:48:31+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.11-1.el9 started.
‘/var/lib/mysql/mysql.sock’ → ‘/var/run/mysqld/mysqld.sock’
2026-09-18T03:48:31.347058Z 0 [System] [MY-015015] [Server] MySQL Server - start.
2026-09-18T03:48:31.537479Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.4.11) starting as process 1
2026-09-18T03:48:31.542784Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2026-09-18T03:48:32.258115Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2026-09-18T03:48:32.569208Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2026-09-18T03:48:32.569256Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2026-09-18T03:48:32.573003Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location ‘/var/run/mysqld’ in the path is accessible to all OS users. Consider choosing a different directory.
2026-09-18T03:48:32.626817Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: ‘::’ port: 33060, socket: /var/run/mysqld/mysqlx.sock
2026-09-18T03:48:32.626897Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: ‘8.4.11’ socket: ‘/var/run/mysqld/mysqld.sock’ port: 3306 MySQL Community Server - GPL.
2026-09-18T03:48:49.892329Z 0 [System] [MY-013172] [Server] Received SHUTDOWN from user . Shutting down mysqld (Version: 8.4.11).
2026-09-18T03:48:50.973405Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.4.11) MySQL Community Server - GPL.
2026-09-18T03:48:50.973424Z 0 [System] [MY-015016] [Server] MySQL Server - end.
2026-09-18 03:48:51+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.11-1.el9 started.
2026-09-18 03:48:51+00:00 [Note] [Entrypoint]: Switching to dedicated user ‘mysql’
2026-09-18 03:48:51+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.11-1.el9 started.
‘/var/lib/mysql/mysql.sock’ → ‘/var/run/mysqld/mysqld.sock’
2026-09-18T03:48:51.821883Z 0 [System] [MY-015015] [Server] MySQL Server - start.
2026-09-18T03:48:52.020477Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.4.11) starting as process 1
2026-09-18T03:48:52.026449Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2026-09-18T03:48:52.764485Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2026-09-18T03:48:53.162641Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2026-09-18T03:48:53.162682Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2026-09-18T03:48:53.166623Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location ‘/var/run/mysqld’ in the path is accessible to all OS users. Consider choosing a different directory.
2026-09-18T03:48:53.225372Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: ‘::’ port: 33060, socket: /var/run/mysqld/mysqlx.sock
2026-09-18T03:48:53.225599Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: ‘8.4.11’ socket: ‘/var/run/mysqld/mysqld.sock’ port: 3306 MySQL Community Server - GPL.
2026-09-18T03:51:41.953131Z 0 [System] [MY-013172] [Server] Received SHUTDOWN from user . Shutting down mysqld (Version: 8.4.11).
2026-09-18T03:51:42.633196Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.4.11) MySQL Community Server - GPL.
2026-09-18T03:51:42.633216Z 0 [System] [MY-015016] [Server] MySQL Server - end.
2026-09-18 03:53:12+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.11-1.el9 started.
2026-09-18 03:53:12+00:00 [Note] [Entrypoint]: Switching to dedicated user ‘mysql’
2026-09-18 03:53:12+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.11-1.el9 started.
‘/var/lib/mysql/mysql.sock’ → ‘/var/run/mysqld/mysqld.sock’
2026-09-18T03:53:12.592179Z 0 [System] [MY-015015] [Server] MySQL Server - start.
2026-09-18T03:53:12.788643Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.4.11) starting as process 1
2026-09-18T03:53:12.793866Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2026-09-18T03:53:13.383660Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2026-09-18T03:53:13.707713Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2026-09-18T03:53:13.707752Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2026-09-18T03:53:13.711449Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location ‘/var/run/mysqld’ in the path is accessible to all OS users. Consider choosing a different directory.
2026-09-18T03:53:13.770586Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: ‘::’ port: 33060, socket: /var/run/mysqld/mysqlx.sock
2026-09-18T03:53:13.770828Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: ‘8.4.11’ socket: ‘/var/run/mysqld/mysqld.sock’ port: 3306 MySQL Community Server - GPL.

以下是OpenResty的日志(100条内):

2026/09/18 02:27:51 [error] 7#7: *5827 open() “/usr/share/nginx/html/proxy” failed (2: No such file or directory), client: 204.76.203.31, server: _, request: “GET /proxy?url=http%3A%2F%2F169.254.169.254%2Flatest%2Fmeta-data%2Fiam%2Fsecurity-credentials%2F HTTP/1.1”, host: “150.230.3.191:80”
204.76.203.31 - - [18/Sep/2026:02:27:51 +0000] “GET /proxy?url=http%3A%2F%2F169.254.169.254%2Flatest%2Fmeta-data%2Fiam%2Fsecurity-credentials%2F HTTP/1.1” 404 150 “-” “Mozilla/5.0” “-”
204.76.203.31 - - [18/Sep/2026:02:27:51 +0000] “GET /?redirect=http%3A%2F%2F169.254.169.254%2Flatest%2Fmeta-data%2Fiam%2Fsecurity-credentials%2F HTTP/1.1” 200 130 “-” “Mozilla/5.0” “-”
204.76.203.31 - - [18/Sep/2026:02:27:51 +0000] “POST / HTTP/1.1” 400 252 “-” “Mozilla/5.0” “-”
204.76.203.31 - - [18/Sep/2026:02:27:51 +0000] “GET /actuator/env HTTP/1.1” 400 252 “-” “Go-http-client/1.1” “-”
204.76.203.31 - - [18/Sep/2026:02:27:51 +0000] “GET /.git/config HTTP/1.1” 400 252 “-” “Mozilla/5.0” “-”
204.76.203.31 - - [18/Sep/2026:02:27:51 +0000] “GET /?load=http%3A%2F%2F169.254.169.254%2Flatest%2Fmeta-data%2Fiam%2Fsecurity-credentials%2F HTTP/1.1” 200 130 “-” “Mozilla/5.0” “-”
2026/09/18 02:27:51 [error] 7#7: *5827 open() “/usr/share/nginx/html/image” failed (2: No such file or directory), client: 204.76.203.31, server: _, request: “GET /image?url=http%3A%2F%2F169.254.169.254%2Flatest%2Fmeta-data%2Fiam%2Fsecurity-credentials%2F HTTP/1.1”, host: “150.230.3.191:80”
204.76.203.31 - - [18/Sep/2026:02:27:51 +0000] “GET /image?url=http%3A%2F%2F169.254.169.254%2Flatest%2Fmeta-data%2Fiam%2Fsecurity-credentials%2F HTTP/1.1” 404 150 “-” “Mozilla/5.0” “-”
204.76.203.31 - - [18/Sep/2026:02:27:52 +0000] “GET /?fetch=http%3A%2F%2F169.254.169.254%2Flatest%2Fmeta-data%2Fiam%2Fsecurity-credentials%2F HTTP/1.1” 200 130 “-” “Mozilla/5.0” “-”
2026/09/18 02:27:52 [error] 7#7: *5827 “/usr/share/nginx/html/next=http:/169.254.169.254/latest/meta-data/iam/security-credentials/404.html” is not found (2: No such file or directory), client: 204.76.203.31, server: _, request: “GET /next=http%3A%2F%2F169.254.169.254%2Flatest%2Fmeta-data%2Fiam%2Fsecurity-credentials%2F HTTP/1.1”, host: “150.230.3.191:80”
204.76.203.31 - - [18/Sep/2026:02:27:52 +0000] “GET /next=http%3A%2F%2F169.254.169.254%2Flatest%2Fmeta-data%2Fiam%2Fsecurity-credentials%2F HTTP/1.1” 404 150 “-” “Mozilla/5.0” “-”
204.76.203.31 - - [18/Sep/2026:02:27:52 +0000] “GET /?url=http%3A%2F%2Fmetadata.google.internal%2FcomputeMetadata%2Fv1%2Finstance%2Fservice-accounts%2F HTTP/1.1” 200 130 “-” “Mozilla/5.0” “-”
2026/09/18 02:27:52 [error] 7#7: *5827 open() “/usr/share/nginx/html/load” failed (2: No such file or directory), client: 204.76.203.31, server: _, request: “GET /load?url=http%3A%2F%2Fmetadata.google.internal%2FcomputeMetadata%2Fv1%2Finstance%2Fservice-accounts%2F HTTP/1.1”, host: “150.230.3.191:80”
204.76.203.31 - - [18/Sep/2026:02:27:52 +0000] “GET /load?url=http%3A%2F%2Fmetadata.google.internal%2FcomputeMetadata%2Fv1%2Finstance%2Fservice-accounts%2F HTTP/1.1” 404 150 “-” “Mozilla/5.0” “-”
2026/09/18 02:27:53 [error] 7#7: *5827 “/usr/share/nginx/html/next=http:/metadata.google.internal/computeMetadata/v1/instance/service-accounts/404.html” is not found (2: No such file or directory), client: 204.76.203.31, server: _, request: “GET /next=http%3A%2F%2Fmetadata.google.internal%2FcomputeMetadata%2Fv1%2Finstance%2Fservice-accounts%2F HTTP/1.1”, host: “150.230.3.191:80”
204.76.203.31 - - [18/Sep/2026:02:27:53 +0000] “GET /next=http%3A%2F%2Fmetadata.google.internal%2FcomputeMetadata%2Fv1%2Finstance%2Fservice-accounts%2F HTTP/1.1” 404 150 “-” “Mozilla/5.0” “-”
178.128.244.211 - - [18/Sep/2026:02:47:36 +0000] “GET / HTTP/1.1” 200 130 “-” “Mozilla/5.0 (compatible; ForestEngine/1.0; +https://forestengine.net/)” “-”
2026/09/18 02:47:36 [error] 7#7: 5879 open() “/usr/share/nginx/html/favicon.ico” failed (2: No such file or directory), client: 178.128.244.211, server: _, request: “GET /favicon.ico HTTP/1.1”, host: “150.230.3.191:80”
178.128.244.211 - - [18/Sep/2026:02:47:36 +0000] “GET /favicon.ico HTTP/1.1” 404 150 “-” “Mozilla/5.0 (compatible; ForestEngine/1.0; +https://forestengine.net/)” “-”
205.210.31.15 - - [18/Sep/2026:02:52:42 +0000] “GET / HTTP/1.0” 200 130 “-” “Hello from Palo Alto Networks, find out more about our scans in https://docs-cortex.paloaltonetworks.com/r/1/Cortex-Xpanse/Scanning-activity” “-”
172.64.198.16 - - [18/Sep/2026:02:53:30 +0000] “GET / HTTP/1.1” 200 130 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36” “unknown,51.38.135.19”
49.175.215.59 - - [18/Sep/2026:03:15:41 +0000] “GET / HTTP/1.0” 200 130 “-” “-” “-”
2026/09/18 03:20:15 [error] 7#7: 5950 open() “/usr/share/nginx/html/.env” failed (2: No such file or directory), client: 78.153.140.39, server: _, request: “GET /.env HTTP/1.1”, host: “150.230.3.191”
78.153.140.39 - - [18/Sep/2026:03:20:15 +0000] “GET /.env HTTP/1.1” 404 552 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.5845.140 Safari/537.36” “-”
78.153.140.39 - - [18/Sep/2026:03:20:15 +0000] “POST / HTTP/1.1” 405 556 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.5845.140 Safari/537.36” “-”
16.5.0.236 - - [18/Sep/2026:03:31:31 +0000] “GET / HTTP/1.1” 200 130 “-” “Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:71.0) Gecko/20100101 Firefox/71.0” “-”
158.94.211.6 - - [18/Sep/2026:03:32:18 +0000] “\x16\x03\x01\x01\x00\x01\x00\x00\xFC\x03\x03|\x86\x12\xF8W\xC6\xF7\xC3\xDB\x003\x7F\xE8\xD5\xEA\xCB\xE35\xE5\xFF\x5Cx\x12\xC8\xDE\xCDedI\x10\xCA\xB8 )\x96\xAF+O\x88\xE2{\x9F\xB9Wh\xBF” 400 154 “-” “-” “-”
158.94.211.6 - - [18/Sep/2026:03:32:22 +0000] "\x16\x03\x01\x01\x00\x01\x00\x00\xFC\x03\x03\xB5\xA4(UQR\x19\x109/Q\xBD\x9F\x93
\xB1\xF4\x91Y\x83
h\x09(4\xA2\x06\xB1\x5C|\xC0\xFF \x5C\xCA\xF7^Rp_n\xFCGRgD\x9E\x8B\xEB\xD8:I\xF3h\x8A\x19\x13\x01bC\xD4\xF9\xC38l\x00\x1A\xC0+\xC0/\xC0,\xC00\xCC\xA9\xCC\xA8\xC0\x09\xC0\x13\xC0" 400 154 “-” “-” “-”
198.235.24.129 - - [18/Sep/2026:03:35:11 +0000] “\x16\x03\x01\x00\xEE\x01\x00\x00\xEA\x03\x03\x01\xB2\xED\x15\xDD\x08[lc\x0F\xE9A(\x8DvA>g\xC7\xC0\xCC\x9EV\x16J\xDC \x09\x86\xFAx\xFD \x9CR\x15\x9C\x14\x0B\xDDt\x84P<,=4\x10\x1Es\xC7\x85X\x10\x84G\x97\x8Cj\x80\xAB\xA6\xE1\xCF\xDE\x00&\xC0+\xC0/\xC0,\xC00\xCC\xA9\xCC\xA8\xC0\x09\xC0\x13\xC0” 400 154 “-” “-” “-”
198.235.24.129 - - [18/Sep/2026:03:35:11 +0000] “\x16\x03\x01\x00\xCA\x01\x00\x00\xC6\x03\x03\xF9\x9C\xFB\xD82\xF1\xBAo\x8B\xC8I\x93\xFCC\x96|\xF7\xD5y\x87\xB9?f\xFA\xBA\xCBygY\x0E1W\x00\x00h\xCC\x14\xCC\x13\xC0/\xC0+\xC00\xC0,\xC0\x11\xC0\x07\xC0’\xC0#\xC0\x13\xC0\x09\xC0(\xC0$\xC0\x14\xC0” 400 154 “-” “-” “-”
158.94.211.20 - - [18/Sep/2026:03:42:43 +0000] “\x16\x03\x01\x01\x00\x01\x00\x00\xFC\x03\x03,\xE3\x83\x9B\x1E;\xB6\x06\xB4\xEB\xCB\xB5\xB5\xC7\xE26\x83\xC71#<\xF9;\xFF6\xE6\xCE\xB4-\xF2\xBD\xB8 `\xEDs\x8A\x8F1=Y\xBEZx\x03\x16\xF7y\xCF2\x84{>\x17\xD0\x98\xFE\xC1a\xDD\xF5\x07+uu\x00\x1A\xC0+\xC0/\xC0,\xC00\xCC\xA9\xCC\xA8\xC0\x09\xC0\x13\xC0” 400 154 “-” “-” “-”
158.94.211.20 - - [18/Sep/2026:03:42:47 +0000] “\x16\x03\x01\x01\x00\x01\x00\x00\xFC\x03\x03\x08v\x83t\x92aR\xA4O\xD2\xDEk\xC2>\x85\xC9V\xFEC\xEA\x03\xB0\xE0\xEDr\x98\xFA+\x0C\x02\xF6R Lk\x02\x96\x80\x16\x22J\xC3|\xDD’s\xEC\xF7D\x93sm\xC1\xD6\xD8\xEB\xFEK\xDE\xABg\xC7,\xD6S\x00\x1A\xC0+\xC0/\xC0,\xC00\xCC\xA9\xCC\xA8\xC0\x09\xC0\x13\xC0” 400 154 “-” “-” “-”
2026/09/18 03:42:56 [error] 7#7: *6010 open() “/usr/share/nginx/html/SDK/webLanguage” failed (2: No such file or directory), client: 195.182.16.23, server: _, request: “GET /SDK/webLanguage HTTP/1.1”, host: “150.230.3.191:80”
195.182.16.23 - - [18/Sep/2026:03:42:56 +0000] “GET /SDK/webLanguage HTTP/1.1” 404 552 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.85 Safari/537.36 Edg/90.0.818.46” “-”
2026/09/18 03:49:56 [notice] 1#1: [lua] config.lua:0: (): Load 1Panel WAF Version:2.0
2026/09/18 03:49:56 [error] 1#1: [lua] file.lua:0: (): Failed to open file /usr/local/openresty/1pwaf/data/html/slide.html: No such file or directory
2026/09/18 03:49:56 [error] 1#1: [lua] file.lua:0: (): Failed to open file /usr/local/openresty/1pwaf/data/html/slide.js: No such file or directory
2026/09/18 03:49:56 [error] 1#1: [lua] file.lua:0: (): Failed to open file /usr/local/openresty/1pwaf/data/html/5s.html: No such file or directory
2026/09/18 03:49:56 [error] 1#1: [lua] file.lua:0: (): Failed to open file /usr/local/openresty/1pwaf/data/html/5s.js: No such file or directory
2026/09/18 03:49:56 [error] 1#1: [lua] file.lua:0: (): Failed to open file /usr/local/openresty/1pwaf/data/html/forbidden.html: No such file or directory
2026/09/18 03:49:56 [error] 1#1: [lua] file.lua:0: (): Failed to open file /usr/local/openresty/1pwaf/data/html/cc.html: No such file or directory
2026/09/18 03:49:56 [error] 1#1: [lua] file.lua:0: (): Failed to open file /usr/local/openresty/1pwaf/data/html/unknown.html: No such file or directory
2026/09/18 03:49:56 [error] 1#1: [lua] file.lua:0: (): Failed to open file /usr/local/openresty/1pwaf/data/html/ip.html: No such file or directory
nginx: [error] [lua] file.lua:0: (): Failed to open file /usr/local/openresty/1pwaf/data/html/slide.html: No such file or directory
nginx: [error] [lua] file.lua:0: (): Failed to open file /usr/local/openresty/1pwaf/data/html/slide.js: No such file or directory
nginx: [error] [lua] file.lua:0: (): Failed to open file /usr/local/openresty/1pwaf/data/html/5s.html: No such file or directory
nginx: [error] [lua] file.lua:0: (): Failed to open file /usr/local/openresty/1pwaf/data/html/5s.js: No such file or directory
nginx: [error] [lua] file.lua:0: (): Failed to open file /usr/local/openresty/1pwaf/data/html/forbidden.html: No such file or directory
nginx: [error] [lua] file.lua:0: (): Failed to open file /usr/local/openresty/1pwaf/data/html/cc.html: No such file or directory
nginx: [error] [lua] file.lua:0: (): Failed to open file /usr/local/openresty/1pwaf/data/html/unknown.html: No such file or directory
nginx: [error] [lua] file.lua:0: (): Failed to open file /usr/local/openresty/1pwaf/data/html/ip.html: No such file or directory
nginx: [error] [lua] file.lua:0: (): Failed to open file /usr/local/openresty/1pwaf/data/html/geo.html: No such file or directory
2026/09/18 03:49:56 [error] 1#1: [lua] file.lua:0: (): Failed to open file /usr/local/openresty/1pwaf/data/html/geo.html: No such file or directory
2026/09/18 03:49:56 [notice] 1#1: using the “epoll” event method
2026/09/18 03:49:56 [notice] 1#1: openresty/1.31.1.1
2026/09/18 03:49:56 [notice] 1#1: built by gcc 13.3.0 (Ubuntu 13.3.0-6ubuntu2~24.04.1)
2026/09/18 03:49:56 [notice] 1#1: OS: Linux 6.17.0-1020-oracle
2026/09/18 03:49:56 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1024:524288
2026/09/18 03:49:56 [notice] 1#1: start worker processes
2026/09/18 03:49:56 [notice] 1#1: start worker process 6
2026/09/18 03:49:56 [notice] 1#1: start worker process 7
2026/09/18 03:51:39 [notice] 1#1: signal 3 (SIGQUIT) received, shutting down
2026/09/18 03:51:39 [notice] 7#7: gracefully shutting down
2026/09/18 03:51:39 [notice] 6#6: gracefully shutting down
2026/09/18 03:51:39 [notice] 7#7: exiting
2026/09/18 03:51:39 [notice] 6#6: exiting
2026/09/18 03:51:39 [notice] 1#1: signal 17 (SIGCHLD) received from 7
2026/09/18 03:51:39 [notice] 1#1: worker process 6 exited with code 0
2026/09/18 03:51:39 [notice] 1#1: worker process 7 exited with code 0
2026/09/18 03:51:39 [notice] 1#1: exit
2026/09/18 03:53:09 [notice] 1#1: [lua] config.lua:0: (): Load 1Panel WAF Version:2.0
2026/09/18 03:53:09 [error] 1#1: [lua] file.lua:0: (): Failed to open file /usr/local/openresty/1pwaf/data/html/slide.html: No such file or directory
nginx: [error] [lua] file.lua:0: (): Failed to open file /usr/local/openresty/1pwaf/data/html/slide.html: No such file or directory
2026/09/18 03:53:09 [error] 1#1: [lua] file.lua:0: (): Failed to open file /usr/local/openresty/1pwaf/data/html/slide.js: No such file or directory
nginx: [error] [lua] file.lua:0: (): Failed to open file /usr/local/openresty/1pwaf/data/html/slide.js: No such file or directory
2026/09/18 03:53:09 [error] 1#1: [lua] file.lua:0: (): Failed to open file /usr/local/openresty/1pwaf/data/html/5s.html: No such file or directory
nginx: [error] [lua] file.lua:0: (): Failed to open file /usr/local/openresty/1pwaf/data/html/5s.html: No such file or directory
2026/09/18 03:53:09 [error] 1#1: [lua] file.lua:0: (): Failed to open file /usr/local/openresty/1pwaf/data/html/5s.js: No such file or directory
2026/09/18 03:53:09 [error] 1#1: [lua] file.lua:0: (): Failed to open file /usr/local/openresty/1pwaf/data/html/forbidden.html: No such file or directory
2026/09/18 03:53:09 [error] 1#1: [lua] file.lua:0: (): Failed to open file /usr/local/openresty/1pwaf/data/html/cc.html: No such file or directory
2026/09/18 03:53:09 [error] 1#1: [lua] file.lua:0: (): Failed to open file /usr/local/openresty/1pwaf/data/html/unknown.html: No such file or directory
2026/09/18 03:53:09 [error] 1#1: [lua] file.lua:0: (): Failed to open file /usr/local/openresty/1pwaf/data/html/ip.html: No such file or directory
2026/09/18 03:53:09 [error] 1#1: [lua] file.lua:0: (): Failed to open file /usr/local/openresty/1pwaf/data/html/geo.html: No such file or directory
nginx: [error] [lua] file.lua:0: (): Failed to open file /usr/local/openresty/1pwaf/data/html/5s.js: No such file or directory
nginx: [error] [lua] file.lua:0: (): Failed to open file /usr/local/openresty/1pwaf/data/html/forbidden.html: No such file or directory
nginx: [error] [lua] file.lua:0: (): Failed to open file /usr/local/openresty/1pwaf/data/html/cc.html: No such file or directory
nginx: [error] [lua] file.lua:0: (): Failed to open file /usr/local/openresty/1pwaf/data/html/unknown.html: No such file or directory
nginx: [error] [lua] file.lua:0: (): Failed to open file /usr/local/openresty/1pwaf/data/html/ip.html: No such file or directory
nginx: [error] [lua] file.lua:0: (): Failed to open file /usr/local/openresty/1pwaf/data/html/geo.html: No such file or directory
2026/09/18 03:53:09 [notice] 1#1: using the “epoll” event method
2026/09/18 03:53:09 [notice] 1#1: openresty/1.31.1.1
2026/09/18 03:53:09 [notice] 1#1: built by gcc 13.3.0 (Ubuntu 13.3.0-6ubuntu2~24.04.1)
2026/09/18 03:53:09 [notice] 1#1: OS: Linux 6.17.0-1020-oracle
2026/09/18 03:53:09 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1024:524288
2026/09/18 03:53:09 [notice] 1#1: start worker processes
2026/09/18 03:53:09 [notice] 1#1: start worker process 7
2026/09/18 03:53:09 [notice] 1#1: start worker process 8
104.23.172.117 - - [18/Sep/2026:03:58:03 +0000] “GET / HTTP/1.1” 200 130 “-” “Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.9 Safari/536.5” “91.184.252.72”
16.5.0.236 - - [18/Sep/2026:04:19:35 +0000] “GET / HTTP/1.1” 200 130 “-” “Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:71.0) Gecko/20100101 Firefox/71.0” “-”

以下是PHP的日志:

2026-09-18 03:53:00,458 CRIT Supervisor is running as root. Privileges were not dropped because no user is specified in the config file. If you intend to run as root, you can set user=root in the config file to avoid this message.
2026-09-18 03:53:00,458 INFO Included extra file “/etc/supervisor.d/php-fpm.ini” during parsing
2026-09-18 03:53:00,461 INFO RPC interface ‘supervisor’ initialized
2026-09-18 03:53:00,461 CRIT Server ‘inet_http_server’ running without any HTTP authentication checking
2026-09-18 03:53:00,464 INFO RPC interface ‘supervisor’ initialized
2026-09-18 03:53:00,464 CRIT Server ‘unix_http_server’ running without any HTTP authentication checking
2026-09-18 03:53:00,464 INFO supervisord started with pid 1
2026-09-18 03:53:01,467 INFO spawned: ‘php-fpm_00’ with pid 7
2026-09-18 03:53:01,483 INFO success: php-fpm_00 entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)

日志已经贴出来了,另外使用phpMyAdmin工具是能正常进入/连接数据库管理的。

感觉是 PHP 版本太低 你的项目能用到 PHP 7 的高版本吗

用过7.4和8.0的版本不过也都是连接不上,下面这个是8.0的日志:

2026-09-18 12:54:49,562 CRIT Supervisor is running as root. Privileges were not dropped because no user is specified in the config file. If you intend to run as root, you can set user=root in the config file to avoid this message.
2026-09-18 12:54:49,562 INFO Included extra file “/etc/supervisor.d/php-fpm.ini” during parsing
2026-09-18 12:54:49,568 INFO RPC interface ‘supervisor’ initialized
2026-09-18 12:54:49,568 CRIT Server ‘inet_http_server’ running without any HTTP authentication checking
2026-09-18 12:54:49,571 INFO RPC interface ‘supervisor’ initialized
2026-09-18 12:54:49,571 CRIT Server ‘unix_http_server’ running without any HTTP authentication checking
2026-09-18 12:54:49,571 INFO supervisord started with pid 1
2026-09-18 12:54:50,574 INFO spawned: ‘php-fpm_00’ with pid 7
2026-09-18 12:54:51,576 INFO success: php-fpm_00 entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)