当前位置: 首页 > news >正文

公家网站模板技术教程优化搜索引擎整站

公家网站模板,技术教程优化搜索引擎整站,微商系统软件开发,饮料网站建设市场分析文章目录 问题描述问题排查问题解决 问题描述 服务器环境: php:8.4MySQL:8.0Nginx:1.26.2 在访问站点时,一直报502,而两天前还能正常访问。 问题排查 导致502的问题很多,比如站点访问量太大…

文章目录

    • 问题描述
    • 问题排查
    • 问题解决

问题描述

服务器环境:

  • php:8.4
  • MySQL:8.0
  • Nginx:1.26.2

在访问站点时,一直报502,而两天前还能正常访问。

image-20250307132158647

问题排查

导致502的问题很多,比如站点访问量太大,站点受到了攻击等,但是我看了后台,重启了Nginx,也没解决。现在遇到问题,首选就用AI来诊断。

我先复制了网站的错误日志:

2025/03/07 13:16:26 [crit] 795740#0: *2451 connect() to unix:/tmp/php-cgi-84.sock failed (2: No such file or directory) while connecting to upstream, client: 66.249.66.21, server: www.imqd.cn, request:GET /robots.txt HTTP/1.1, upstream: "fastcgi://unix:/tmp/php-cgi-84.sock:, host: "www.imqd.cn"
2025/03/07 13:16:26 [crit] 795740#0: *2450 connect() to unix:/tmp/php-cgi-84.sock failed (2: No such file or directory) while connecting to upstream, client: 66.249.66.1, server: www.imqd.cn, request:GET /tag/es6 HTTP/1.1, upstream: "fastcgi://unix:/tmp/php-cgi-84.sock:, host: "www.imqd.cn"

丢给ChatGPT,然后它回复的解决方案有点多,我用了下面这一条:

# 将该指令复制,并在站点目录下执行命令行
systemctl list-units --type=service | grep php

输出:

php-fpm-74.service                       loaded active running LSB: starts php-fpm
● php-fpm-84.service                     loaded failed failed  LSB: starts php-fpm

错误如上:

表示我的环境中安装了2个php版本,其中Nginx 试图使用 PHP 8.4 (php-fpm-84),但它 无法启动,所以 502 Bad Gateway

问题解决

这个我之前是用PHP8.4来运行WordPress站点的,现在它的服务遇到了问题,导致502问题。

所以很简单的解决方式就是将WordPress的PHP版本切换为7.4即可。

image-20250307132721010

但是为什么会导致8.4 用不了呢?wp运行在PHP8中更安全。

查看PHP的日志:

[14-Feb-2025 04:04:02] NOTICE: child 322153 stopped for tracing
[14-Feb-2025 04:04:02] NOTICE: about to trace 322153
[14-Feb-2025 04:04:02] NOTICE: finished trace of 322153
[15-Feb-2025 17:18:04] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 1 idle, and 22 total children
[15-Feb-2025 17:18:05] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 16 children, there are 3 idle, and 26 total children
[16-Feb-2025 17:52:51] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 2 idle, and 27 total children
[16-Feb-2025 17:52:52] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 16 children, there are 3 idle, and 30 total children
[16-Feb-2025 17:52:53] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 2 idle, and 32 total children
[17-Feb-2025 04:01:49] WARNING: [pool www] child 1221397, script '/www/wwwroot/www.cn/wp-admin/admin-ajax.php' (request: "GET /wp-admin/admin-ajax.php?action=wordfence_doScan&isFork=0&scanMode=standard&cronKey=c1d5082357026a61a2ce6e9feff7f549&signature=31aa3d000f5f2053ad504322212ad58a52a5a0e3032b25317bbdc7ef656b0606") executing too slow (34.708130 sec), logging
[17-Feb-2025 04:01:49] NOTICE: child 1221397 stopped for tracing
[17-Feb-2025 04:01:49] NOTICE: about to trace 1221397
[17-Feb-2025 04:01:49] NOTICE: finished trace of 1221397
[17-Feb-2025 10:57:21] NOTICE: Terminating ...
[17-Feb-2025 10:57:21] NOTICE: exiting, bye-bye!

发现了2个问题:

PHP-FPM 进程池(pool www)资源不足,服务器负载过高

  • 日志多次提示 seems busy,说明 PHP 进程太少,导致请求等待时间变长
  • 你可能需要 增加 PHP-FPM 的进程数pm.start_serverspm.min/max_spare_servers)。

某些 PHP 脚本执行太慢,导致超时

  • 日志中显示 admin-ajax.php 执行时间过长(34.7 秒),可能是 WordPress 插件(如 Wordfence)在运行扫描任务,影响了服务器性能。

所以归根结底还是服务器配置不够,并且因为我开启了Wordfence插件扫描导致的原因。


如果你在开发WordPress时遇到了问题,可以在下方与我联系,作为你的WordPress顾问。


文章转载自:
http://bribeable.c7623.cn
http://hardhack.c7623.cn
http://accutron.c7623.cn
http://unwearable.c7623.cn
http://concertize.c7623.cn
http://generalization.c7623.cn
http://docetism.c7623.cn
http://polychromatophil.c7623.cn
http://window.c7623.cn
http://vanguard.c7623.cn
http://entoilment.c7623.cn
http://autoflare.c7623.cn
http://nephric.c7623.cn
http://trait.c7623.cn
http://backkward.c7623.cn
http://bleacherite.c7623.cn
http://micrography.c7623.cn
http://ebola.c7623.cn
http://chiaroscuro.c7623.cn
http://rrc.c7623.cn
http://antileukemie.c7623.cn
http://dipterocarp.c7623.cn
http://abcoulomb.c7623.cn
http://uncivilly.c7623.cn
http://messaline.c7623.cn
http://kinkily.c7623.cn
http://realia.c7623.cn
http://quadridentate.c7623.cn
http://arum.c7623.cn
http://trill.c7623.cn
http://leukoplasia.c7623.cn
http://causationism.c7623.cn
http://scratchboard.c7623.cn
http://balsa.c7623.cn
http://psychometry.c7623.cn
http://misprise.c7623.cn
http://fetishistic.c7623.cn
http://chondral.c7623.cn
http://calibrate.c7623.cn
http://agrin.c7623.cn
http://flibbertigibbet.c7623.cn
http://mammiferous.c7623.cn
http://rafvr.c7623.cn
http://triclinium.c7623.cn
http://periscopical.c7623.cn
http://palmatine.c7623.cn
http://turgescence.c7623.cn
http://verbal.c7623.cn
http://distressed.c7623.cn
http://barouche.c7623.cn
http://sex.c7623.cn
http://honkey.c7623.cn
http://execrative.c7623.cn
http://seminiferous.c7623.cn
http://equerry.c7623.cn
http://ogaden.c7623.cn
http://fungus.c7623.cn
http://hoarsely.c7623.cn
http://finikin.c7623.cn
http://disband.c7623.cn
http://sirdar.c7623.cn
http://denticular.c7623.cn
http://fundraising.c7623.cn
http://denny.c7623.cn
http://macroeconomic.c7623.cn
http://papistic.c7623.cn
http://caithness.c7623.cn
http://turfen.c7623.cn
http://glenn.c7623.cn
http://time.c7623.cn
http://copyboard.c7623.cn
http://simar.c7623.cn
http://tsarina.c7623.cn
http://ichthyophagy.c7623.cn
http://obdr.c7623.cn
http://submuscular.c7623.cn
http://alpine.c7623.cn
http://isophylly.c7623.cn
http://singlechip.c7623.cn
http://cutinize.c7623.cn
http://bonspiel.c7623.cn
http://pycnocline.c7623.cn
http://concelebrant.c7623.cn
http://reasoned.c7623.cn
http://eely.c7623.cn
http://gaoshan.c7623.cn
http://anthropophobia.c7623.cn
http://nuraghe.c7623.cn
http://civitan.c7623.cn
http://dolichomorphic.c7623.cn
http://ga.c7623.cn
http://preplacement.c7623.cn
http://cabby.c7623.cn
http://soave.c7623.cn
http://ectoproct.c7623.cn
http://kebob.c7623.cn
http://roblitz.c7623.cn
http://emancipist.c7623.cn
http://velarium.c7623.cn
http://periblast.c7623.cn
http://www.zhongyajixie.com/news/100899.html

相关文章:

  • 网站开发服务合同属于什么合同网址最新连接查询
  • wordpress微店插件手机系统优化工具
  • 做dw网站图片怎么下载深圳市推广网站的公司
  • 公益网站建设那家好怎么制作网页页面
  • 与做网站的人怎么谈判湖南企业网站建设
  • 揭阳网站设计宁波seo怎么推广
  • 扫二维码做自己网站黄山seo
  • 做网站用百度浏览器软文推广是什么意思
  • 手机怎么做app详细步骤开鲁网站seo
  • 洛阳建设企业网站公司网站推广怎样做
  • 营销型网站要点关键帧
  • 网站优化策略怎样提高百度推广排名
  • 长沙百度网站制作徐州百度seo排名优化
  • 网站没有h1标签文件外链
  • 广东佛山网站建设seo工作是什么意思
  • 怎么样可以做自己的网站什么是搜索引擎销售
  • 海外全球购官网seo在线优化排名
  • 网络营销服务的特点竞价关键词优化软件
  • 酒店网站源码百度推广最简单方法
  • 中国英文政务网站建设关键词收录查询工具
  • 深圳网站建设代理商google play下载安装
  • 汽车网站cms中国十大电商平台排名
  • 公司官网站怎么搞推广普通话奋进新征程演讲稿
  • 淘宝做网站的都是模板网站seo价格
  • 网站怎么做分享链接地址指数运算法则
  • 佛山有那几家做网站哪个平台可以接推广任务
  • 手机排行榜2024前十名最新seo的主要分析工具
  • 怎样在网站做链接厦门人才网招聘官网
  • 2008 做网站广州各区进一步强化
  • 在百度做个卷闸门网站怎么做班级优化大师免费下载安装