{"id":975,"date":"2026-10-29T09:15:01","date_gmt":"2026-10-29T01:15:01","guid":{"rendered":"https:\/\/liuqiangwujinjidian.com\/?p=975"},"modified":"2026-10-29T20:10:32","modified_gmt":"2026-10-29T12:10:32","slug":"wordpress-php-upgrade-502-permission-denied","status":"publish","type":"post","link":"https:\/\/liuqiangwujinjidian.com\/index.php\/2026\/10\/29\/wordpress-php-upgrade-502-permission-denied\/","title":{"rendered":"WordPress \u5347\u7ea7 PHP \u540e\u51fa\u73b0 502\uff1f\u770b\u65e5\u5fd7\u627e\u5230 Permission denied"},"content":{"rendered":"<p><strong>\u5347\u7ea7 PHP\uff0c\u672c\u6765\u662f\u60f3\u628a\u7f51\u7ad9\u7ef4\u62a4\u597d\u4e00\u70b9\uff0c\u7ed3\u679c\u7248\u672c\u521a\u5207\u8fc7\u53bb\uff0cWordPress \u540e\u53f0\u5c31\u53d8\u6210\u4e86 502 Bad Gateway\u3002<\/strong><\/p>\n<p>\u6211\u8fd9\u6b21\u628a\u4e3b\u7f51\u7ad9\u4ece PHP 8.2.31 \u5347\u7ea7\u5230 PHP 8.3.36\u3002\u65b0\u7248\u672c\u88c5\u597d\u4e86\uff0c\u6269\u5c55\u4e5f\u8865\u9f50\u4e86\uff0cPHP-FPM \u663e\u793a\u6b63\u5e38\u8fd0\u884c\uff0c\u4f46\u7f51\u7ad9\u8fd8\u662f\u6253\u4e0d\u5f00\u3002<\/p>\n<p>\u6700\u540e\u67e5\u51fa\u6765\uff0c\u95ee\u9898\u51fa\u5728 <strong>Nginx \u6ca1\u6709\u6743\u9650\u8fde\u63a5 PHP 8.3 \u7684\u5957\u63a5\u5b57<\/strong>\u3002\u53e6\u5916\u8fd8\u53d1\u73b0\uff0c\u6211\u8fd9\u53f0\u670d\u52a1\u5668\u4e0a\u6709\u4e24\u5957 Nginx\uff0c\u5b9d\u5854\u91cc\u4fee\u6539\u7684\u914d\u7f6e\uff0c\u5e76\u4e0d\u662f\u7f51\u7ad9\u5b9e\u9645\u4f7f\u7528\u7684\u90a3\u4e00\u5957\u3002<\/p>\n<p>\u65e5\u5fd7\u91cc\u771f\u6b63\u6307\u660e\u65b9\u5411\u7684\u662f\u8fd9\u4e00\u53e5\uff1a<\/p>\n<pre style=\"width:100%;max-width:760px;overflow-x:auto;white-space:pre;margin:20px auto;padding:18px;border:1px solid #dfe5ec;border-radius:10px;background:#f6f8fa;color:#17212f;font-size:14px;line-height:1.7;box-sizing:border-box\"><code>(13: Permission denied) while connecting to upstream<\/code><\/pre>\n<p>\u8fd9\u7bc7\u628a\u6211\u5f53\u65f6\u600e\u4e48\u67e5\u3001\u600e\u4e48\u56de\u9000\u3001\u6700\u540e\u600e\u4e48\u4fee\u597d\u7684\u8fc7\u7a0b\u8bb0\u4e0b\u6765\u3002<\/p>\n<p><small>\u6545\u969c\u53d1\u751f\u4e8e 2026 \u5e74 10 \u6708 28 \u65e5\uff0c\u540e\u7eed\u9a8c\u8bc1\u5b8c\u6210\u4e8e 10 \u6708 29 \u65e5\u3002PHP 8.3.36 \u662f\u8fd9\u6b21\u5347\u7ea7\u4f7f\u7528\u7684\u7248\u672c\uff0c\u4e0d\u4ee3\u8868\u4f60\u9605\u8bfb\u65f6\u7684\u6700\u65b0\u7248\u672c\u3002<\/small><\/p>\n<h2 id=\"step-1\" style=\"color:#111111;font-weight:700;scroll-margin-top:130px\">\u4e00\u3001\u4e3a\u4ec0\u4e48\u8981\u5347\u7ea7 PHP\uff1f<\/h2>\n<p>\u6211\u7684\u7f51\u7ad9\u4f7f\u7528 WordPress\uff0c\u670d\u52a1\u5668\u662f InterServer VPS\uff0c\u7cfb\u7edf\u662f Ubuntu\uff0c\u88c5\u4e86\u5b9d\u5854\u9762\u677f\u3002<\/p>\n<p>\u4e4b\u524d\u7ad9\u70b9\u5065\u5eb7\u91cc\u63d0\u793a PHP \u7248\u672c\u8f83\u65e7\u3002\u6211\u5148\u5b89\u88c5\u4e86 PHP 8.3.36\uff0c\u53c8\u7ed9\u65b0\u7248\u672c\u8865\u4e0a OPcache\u3001fileinfo\u3001Imagick \u548c exif\u3002<\/p>\n<p>\u5b89\u88c5\u540e\u68c0\u67e5\uff0c\u6269\u5c55\u80fd\u52a0\u8f7d\uff0cPHP-FPM \u914d\u7f6e\u6d4b\u8bd5\u4e5f\u901a\u8fc7\u4e86\u3002<\/p>\n<p><strong>\u4f46\u5230\u8fd9\u91cc\uff0c\u53ea\u80fd\u8bf4\u660e PHP \u672c\u8eab\u51c6\u5907\u597d\u4e86\uff0c\u8fd8\u4e0d\u80fd\u8bf4\u660e\u7f51\u7ad9\u5df2\u7ecf\u80fd\u6b63\u5e38\u4f7f\u7528\u5b83\u3002<\/strong>\u540e\u9762\u7684\u95ee\u9898\uff0c\u5c31\u662f\u5728\u7f51\u7ad9\u4e0e PHP \u7684\u8fde\u63a5\u4e0a\u3002<\/p>\n<h2 id=\"step-2\" style=\"color:#111111;font-weight:700;scroll-margin-top:130px\">\u4e8c\u3001\u5b9d\u5854\u5207\u5230\u4e86 PHP 8.3\uff0cWordPress \u4e3a\u4ec0\u4e48\u8fd8\u663e\u793a 8.2\uff1f<\/h2>\n<p>\u6211\u5148\u5728\u5b9d\u5854\u7684\u7f51\u7ad9\u8bbe\u7f6e\u91cc\u9009\u62e9 PHP 8.3\uff0c\u5207\u6362\u540e\u518d\u770b WordPress \u7684\u7ad9\u70b9\u5065\u5eb7\uff0c\u91cc\u9762\u4ecd\u7136\u663e\u793a PHP 8.2.31\u3002<\/p>\n<p>\u4e00\u5f00\u59cb\u4ee5\u4e3a\u662f\u9875\u9762\u6ca1\u5237\u65b0\u3002\u540e\u6765\u68c0\u67e5\u5b9d\u5854\u7684\u7f51\u7ad9\u914d\u7f6e\uff0c\u786e\u5b9e\u5df2\u7ecf\u6307\u5411 PHP 8.3\uff1a<\/p>\n<pre style=\"width:100%;max-width:760px;overflow-x:auto;white-space:pre;margin:20px auto;padding:18px;border:1px solid #dfe5ec;border-radius:10px;background:#f6f8fa;color:#17212f;font-size:14px;line-height:1.7;box-sizing:border-box\"><code>include enable-php-83.conf;<\/code><\/pre>\n<p>\u5bf9\u5e94\u7684\u8f6c\u53d1\u914d\u7f6e\u4e5f\u6ca1\u6709\u5199\u9519\uff1a<\/p>\n<pre style=\"width:100%;max-width:760px;overflow-x:auto;white-space:pre;margin:20px auto;padding:18px;border:1px solid #dfe5ec;border-radius:10px;background:#f6f8fa;color:#17212f;font-size:14px;line-height:1.7;box-sizing:border-box\"><code>fastcgi_pass unix:\/tmp\/php-cgi-83.sock;<\/code><\/pre>\n<p>\u4f46\u91cd\u65b0\u52a0\u8f7d\u5b9d\u5854 Nginx \u65f6\uff0c\u7ec8\u7aef\u62a5\u9519\uff1a<\/p>\n<pre style=\"width:100%;max-width:760px;overflow-x:auto;white-space:pre;margin:20px auto;padding:18px;border:1px solid #dfe5ec;border-radius:10px;background:#f6f8fa;color:#17212f;font-size:14px;line-height:1.7;box-sizing:border-box\"><code>nginx: [alert] kill(75905, 1) failed (3: No such process)<\/code><\/pre>\n<p>\u610f\u601d\u662f\uff0c\u5b83\u6309\u7167 PID \u6587\u4ef6\u627e\u5230\u7684\u90a3\u4e2a\u8fdb\u7a0b\uff0c\u5df2\u7ecf\u4e0d\u5b58\u5728\u4e86\u3002<\/p>\n<p>\u7ee7\u7eed\u67e5\u770b\u8fd0\u884c\u4e2d\u7684 Nginx\uff0c\u624d\u53d1\u73b0\u5b9e\u9645\u63d0\u4f9b\u7f51\u7ad9\u670d\u52a1\u7684\u662f\uff1a<\/p>\n<pre style=\"width:100%;max-width:760px;overflow-x:auto;white-space:pre;margin:20px auto;padding:18px;border:1px solid #dfe5ec;border-radius:10px;background:#f6f8fa;color:#17212f;font-size:14px;line-height:1.7;box-sizing:border-box\"><code>\/usr\/sbin\/nginx<\/code><\/pre>\n<p>\u800c\u521a\u624d\u68c0\u67e5\u548c\u64cd\u4f5c\u7684\u662f\uff1a<\/p>\n<pre style=\"width:100%;max-width:760px;overflow-x:auto;white-space:pre;margin:20px auto;padding:18px;border:1px solid #dfe5ec;border-radius:10px;background:#f6f8fa;color:#17212f;font-size:14px;line-height:1.7;box-sizing:border-box\"><code>\/www\/server\/nginx\/sbin\/nginx<\/code><\/pre>\n<p><strong>\u4e24\u5957 Nginx\uff0c\u4e0d\u662f\u540c\u4e00\u4efd\u914d\u7f6e\u3002\u5b9d\u5854\u91cc\u663e\u793a\u5207\u6362\u6210\u529f\uff0c\u4e0d\u4ee3\u8868\u6b63\u5728\u8fd0\u884c\u7684\u7f51\u7ad9\u5df2\u7ecf\u5207\u8fc7\u53bb\u3002<\/strong><\/p>\n<p>\u6211\u4e3b\u7f51\u7ad9\u5b9e\u9645\u4f7f\u7528\u7684\u914d\u7f6e\u4f4d\u4e8e\uff1a<\/p>\n<pre style=\"width:100%;max-width:760px;overflow-x:auto;white-space:pre;margin:20px auto;padding:18px;border:1px solid #dfe5ec;border-radius:10px;background:#f6f8fa;color:#17212f;font-size:14px;line-height:1.7;box-sizing:border-box\"><code>\/etc\/nginx\/sites-enabled\/liuqiangwujinjidian.com<\/code><\/pre>\n<p>\u91cc\u9762\u4ecd\u7136\u5199\u7740\uff1a<\/p>\n<pre style=\"width:100%;max-width:760px;overflow-x:auto;white-space:pre;margin:20px auto;padding:18px;border:1px solid #dfe5ec;border-radius:10px;background:#f6f8fa;color:#17212f;font-size:14px;line-height:1.7;box-sizing:border-box\"><code>fastcgi_pass unix:\/tmp\/php-cgi-82.sock;<\/code><\/pre>\n<p>\u6240\u4ee5 WordPress \u663e\u793a PHP 8.2\uff0c\u5e76\u6ca1\u6709\u663e\u793a\u9519\u3002<\/p>\n<h2 id=\"step-3\" style=\"color:#111111;font-weight:700;scroll-margin-top:130px\">\u4e09\u3001\u6539\u4e86\u5b9e\u9645\u914d\u7f6e\uff0c\u7f51\u7ad9\u5374\u51fa\u73b0 502<\/h2>\n<p>\u627e\u5230\u771f\u6b63\u751f\u6548\u7684\u914d\u7f6e\u540e\uff0c\u6211\u5148\u5907\u4efd\uff0c\u518d\u628a\u4e3b\u7f51\u7ad9\u7684 PHP \u8f6c\u53d1\u5730\u5740\u6539\u6210\uff1a<\/p>\n<pre style=\"width:100%;max-width:760px;overflow-x:auto;white-space:pre;margin:20px auto;padding:18px;border:1px solid #dfe5ec;border-radius:10px;background:#f6f8fa;color:#17212f;font-size:14px;line-height:1.7;box-sizing:border-box\"><code>fastcgi_pass unix:\/tmp\/php-cgi-83.sock;<\/code><\/pre>\n<p>\u7136\u540e\u68c0\u67e5\u7cfb\u7edf Nginx \u914d\u7f6e\uff1a<\/p>\n<pre style=\"width:100%;max-width:760px;overflow-x:auto;white-space:pre;margin:20px auto;padding:18px;border:1px solid #dfe5ec;border-radius:10px;background:#f6f8fa;color:#17212f;font-size:14px;line-height:1.7;box-sizing:border-box\"><code>\/usr\/sbin\/nginx -t<\/code><\/pre>\n<p>\u68c0\u67e5\u901a\u8fc7\uff0c\u518d\u91cd\u65b0\u52a0\u8f7d\uff1a<\/p>\n<pre style=\"width:100%;max-width:760px;overflow-x:auto;white-space:pre;margin:20px auto;padding:18px;border:1px solid #dfe5ec;border-radius:10px;background:#f6f8fa;color:#17212f;font-size:14px;line-height:1.7;box-sizing:border-box\"><code>systemctl reload nginx<\/code><\/pre>\n<p>\u547d\u4ee4\u6ca1\u6709\u62a5\u9519\u3002\u4f46\u56de\u5230\u6d4f\u89c8\u5668\uff0cWordPress \u767b\u5f55\u9875\u51fa\u73b0\uff1a<\/p>\n<pre style=\"width:100%;max-width:760px;overflow-x:auto;white-space:pre;margin:20px auto;padding:18px;border:1px solid #dfe5ec;border-radius:10px;background:#f6f8fa;color:#17212f;font-size:14px;line-height:1.7;box-sizing:border-box\"><code>502 Bad Gateway\r\nnginx\/1.24.0 (Ubuntu)<\/code><\/pre>\n<p><strong>\u914d\u7f6e\u68c0\u67e5\u901a\u8fc7\uff0c\u4e0d\u7b49\u4e8e\u7f51\u7ad9\u8bf7\u6c42\u4e00\u5b9a\u80fd\u8dd1\u901a\u3002<\/strong>\u8fd9\u6b21 Nginx \u914d\u7f6e\u8bed\u6cd5\u6ca1\u95ee\u9898\uff0cPHP 8.3 \u4e5f\u6b63\u5728\u8fd0\u884c\uff0c\u4f46\u4e24\u8005\u4e4b\u95f4\u8fd8\u662f\u6ca1\u6709\u8fde\u4e0a\u3002<\/p>\n<h2 id=\"step-4\" style=\"color:#111111;font-weight:700;scroll-margin-top:130px\">\u56db\u3001\u5148\u56de\u9000\u5230 PHP 8.2\uff0c\u518d\u67e5\u539f\u56e0<\/h2>\n<p>\u7f51\u7ad9\u5df2\u7ecf\u6253\u4e0d\u5f00\uff0c\u6211\u6ca1\u6709\u7ee7\u7eed\u5728 PHP 8.3 \u4e0a\u53cd\u590d\u8bd5\uff0c\u800c\u662f\u5148\u6062\u590d\u539f\u6765\u7684\u8fde\u63a5\u3002<\/p>\n<p>\u628a\u4e3b\u7f51\u7ad9\u914d\u7f6e\u4e2d\u7684\uff1a<\/p>\n<pre style=\"width:100%;max-width:760px;overflow-x:auto;white-space:pre;margin:20px auto;padding:18px;border:1px solid #dfe5ec;border-radius:10px;background:#f6f8fa;color:#17212f;font-size:14px;line-height:1.7;box-sizing:border-box\"><code>fastcgi_pass unix:\/tmp\/php-cgi-83.sock;<\/code><\/pre>\n<p>\u6539\u56de\uff1a<\/p>\n<pre style=\"width:100%;max-width:760px;overflow-x:auto;white-space:pre;margin:20px auto;padding:18px;border:1px solid #dfe5ec;border-radius:10px;background:#f6f8fa;color:#17212f;font-size:14px;line-height:1.7;box-sizing:border-box\"><code>fastcgi_pass unix:\/tmp\/php-cgi-82.sock;<\/code><\/pre>\n<p>\u518d\u6b21\u68c0\u67e5\u5e76\u91cd\u65b0\u52a0\u8f7d\uff1a<\/p>\n<pre style=\"width:100%;max-width:760px;overflow-x:auto;white-space:pre;margin:20px auto;padding:18px;border:1px solid #dfe5ec;border-radius:10px;background:#f6f8fa;color:#17212f;font-size:14px;line-height:1.7;box-sizing:border-box\"><code>\/usr\/sbin\/nginx -t &amp;&amp; systemctl reload nginx<\/code><\/pre>\n<p>\u8fd9\u6b21\u5347\u7ea7\u524d\uff0cPHP 8.2 \u6ca1\u6709\u5378\u8f7d\uff0c\u539f\u6765\u7684\u8fde\u63a5\u4e5f\u8fd8\u5728\uff0c\u6240\u4ee5\u53ef\u4ee5\u5148\u5207\u56de\u53bb\u3002<\/p>\n<p><strong>\u5bf9\u6211\u8fd9\u79cd\u81ea\u5df1\u7ef4\u62a4\u7f51\u7ad9\u7684\u4eba\u6765\u8bf4\uff0c\u5347\u7ea7\u65f6\u4fdd\u7559\u65e7\u7248\u672c\u5f88\u6709\u5fc5\u8981\u3002\u65b0\u7248\u672c\u6709\u95ee\u9898\uff0c\u81f3\u5c11\u8fd8\u6709\u4e00\u6761\u56de\u53bb\u7684\u8def\u3002<\/strong><\/p>\n<h2 id=\"step-5\" style=\"color:#111111;font-weight:700;scroll-margin-top:130px\">\u4e94\u3001\u65e5\u5fd7\u6307\u51fa\u4e86\u771f\u6b63\u7684\u95ee\u9898\uff1aPermission denied<\/h2>\n<p>\u63a5\u4e0b\u6765\u67e5\u770b\u4e3b\u7f51\u7ad9\u7684 Nginx \u9519\u8bef\u65e5\u5fd7\uff1a<\/p>\n<pre style=\"width:100%;max-width:760px;overflow-x:auto;white-space:pre;margin:20px auto;padding:18px;border:1px solid #dfe5ec;border-radius:10px;background:#f6f8fa;color:#17212f;font-size:14px;line-height:1.7;box-sizing:border-box\"><code>tail -n 20 \/var\/log\/nginx\/liuqiangwujinjidian.com.error.log<\/code><\/pre>\n<p>\u65e5\u5fd7\u91cc\u53cd\u590d\u51fa\u73b0\uff1a<\/p>\n<pre style=\"width:100%;max-width:760px;overflow-x:auto;white-space:pre;margin:20px auto;padding:18px;border:1px solid #dfe5ec;border-radius:10px;background:#f6f8fa;color:#17212f;font-size:14px;line-height:1.7;box-sizing:border-box\"><code>connect() to unix:\/tmp\/php-cgi-83.sock failed\r\n(13: Permission denied) while connecting to upstream<\/code><\/pre>\n<p>\u8fd9\u6761\u4fe1\u606f\u5f88\u5173\u952e\uff1aNginx \u60f3\u8fde\u63a5 PHP 8.3\uff0c\u4f46\u88ab\u6743\u9650\u6321\u4f4f\u4e86\u3002<\/p>\n<p>\u518d\u6bd4\u8f83\u65b0\u65e7\u4e24\u4e2a\u5957\u63a5\u5b57\uff1a<\/p>\n<pre style=\"width:100%;max-width:760px;overflow-x:auto;white-space:pre;margin:20px auto;padding:18px;border:1px solid #dfe5ec;border-radius:10px;background:#f6f8fa;color:#17212f;font-size:14px;line-height:1.7;box-sizing:border-box\"><code>ls -l \/tmp\/php-cgi-82.sock \/tmp\/php-cgi-83.sock<\/code><\/pre>\n<p>\u7ed3\u679c\u662f\uff1a<\/p>\n<pre style=\"width:100%;max-width:760px;overflow-x:auto;white-space:pre;margin:20px auto;padding:18px;border:1px solid #dfe5ec;border-radius:10px;background:#f6f8fa;color:#17212f;font-size:14px;line-height:1.7;box-sizing:border-box\"><code>srw-rw---- 1 www www-data ... \/tmp\/php-cgi-82.sock\r\nsrw------- 1 www www      ... \/tmp\/php-cgi-83.sock<\/code><\/pre>\n<p>\u67e5\u770b Nginx \u5de5\u4f5c\u8fdb\u7a0b\u4f7f\u7528\u7684\u7528\u6237\u548c\u7ec4\uff1a<\/p>\n<pre style=\"width:100%;max-width:760px;overflow-x:auto;white-space:pre;margin:20px auto;padding:18px;border:1px solid #dfe5ec;border-radius:10px;background:#f6f8fa;color:#17212f;font-size:14px;line-height:1.7;box-sizing:border-box\"><code>ps -eo user,group,pid,args | grep '[n]ginx: worker'<\/code><\/pre>\n<p>\u6211\u8fd9\u53f0\u670d\u52a1\u5668\u663e\u793a\u7684\u7528\u6237\u548c\u7ec4\u90fd\u662f\uff1a<\/p>\n<pre style=\"width:100%;max-width:760px;overflow-x:auto;white-space:pre;margin:20px auto;padding:18px;border:1px solid #dfe5ec;border-radius:10px;background:#f6f8fa;color:#17212f;font-size:14px;line-height:1.7;box-sizing:border-box\"><code>www-data www-data<\/code><\/pre>\n<p>\u95ee\u9898\u5c31\u6e05\u695a\u4e86\uff1a<\/p>\n<div style=\"max-width:640px;margin:24px auto;overflow-x:auto;border:1px solid #e2e8f0;border-radius:10px\">\n<table style=\"width:100%;min-width:0;margin:0;border-collapse:collapse;font-size:14px\">\n<thead>\n<tr>\n<th style=\"padding:12px;text-align:left;color:#111111;background:#f1f5f9\">\u9879\u76ee<\/th>\n<th style=\"padding:12px;text-align:left;color:#111111;background:#f1f5f9\">PHP 8.2<\/th>\n<th style=\"padding:12px;text-align:left;color:#111111;background:#f1f5f9\">PHP 8.3<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"padding:12px;overflow-wrap:anywhere\">\u5957\u63a5\u5b57\u6240\u5c5e\u7528\u6237<\/td>\n<td style=\"padding:12px;overflow-wrap:anywhere\">www<\/td>\n<td style=\"padding:12px;overflow-wrap:anywhere\">www<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:12px;overflow-wrap:anywhere\">\u5957\u63a5\u5b57\u6240\u5c5e\u7ec4<\/td>\n<td style=\"padding:12px;overflow-wrap:anywhere\">www-data<\/td>\n<td style=\"padding:12px;overflow-wrap:anywhere\">www<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:12px;overflow-wrap:anywhere\">\u6743\u9650<\/td>\n<td style=\"padding:12px;overflow-wrap:anywhere\">0660<\/td>\n<td style=\"padding:12px;overflow-wrap:anywhere\">0600<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:12px;overflow-wrap:anywhere\">Nginx \u7684 www-data \u7ec4\u80fd\u5426\u8fde\u63a5<\/td>\n<td style=\"padding:12px;overflow-wrap:anywhere\">\u53ef\u4ee5<\/td>\n<td style=\"padding:12px;overflow-wrap:anywhere\">\u6ca1\u6709\u5bf9\u5e94\u6743\u9650<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>\u8fd9\u91cc\u8bf4\u7684\u5957\u63a5\u5b57\uff0c\u53ef\u4ee5\u7406\u89e3\u6210 Nginx \u628a PHP \u8bf7\u6c42\u4ea4\u7ed9 PHP-FPM \u7684\u672c\u673a\u8fde\u63a5\u5165\u53e3\u3002<\/p>\n<p>PHP 8.3 \u867d\u7136\u542f\u52a8\u4e86\uff0c\u4f46\u5b83\u521b\u5efa\u7684\u5165\u53e3\u53ea\u5141\u8bb8 <code>www<\/code> \u7528\u6237\u8bbf\u95ee\u3002\u6211\u7684\u7cfb\u7edf Nginx \u4f7f\u7528 <code>www-data<\/code>\uff0c\u81ea\u7136\u5c31\u8fde\u4e0d\u4e0a\u3002<\/p>\n<p><strong>\u8fd9\u6b21 502 \u7684\u76f4\u63a5\u539f\u56e0\u662f\u8fde\u63a5\u6743\u9650\uff0c\u8fd8\u6ca1\u5230\u5224\u65ad WordPress \u63d2\u4ef6\u662f\u5426\u517c\u5bb9\u90a3\u4e00\u6b65\u3002<\/strong><\/p>\n<h2 id=\"step-6\" style=\"color:#111111;font-weight:700;scroll-margin-top:130px\">\u516d\u3001\u5728 PHP-FPM \u914d\u7f6e\u4e2d\u4fee\u6b63\u6743\u9650<\/h2>\n<p>PHP 8.3 \u5f53\u65f6\u7684\u914d\u7f6e\u662f\uff1a<\/p>\n<pre style=\"width:100%;max-width:760px;overflow-x:auto;white-space:pre;margin:20px auto;padding:18px;border:1px solid #dfe5ec;border-radius:10px;background:#f6f8fa;color:#17212f;font-size:14px;line-height:1.7;box-sizing:border-box\"><code>listen = \/tmp\/php-cgi-83.sock\r\nlisten.owner = www\r\nlisten.group = www\r\nlisten.mode = 0600<\/code><\/pre>\n<p>\u6211\u5148\u5907\u4efd\u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n<pre style=\"width:100%;max-width:760px;overflow-x:auto;white-space:pre;margin:20px auto;padding:18px;border:1px solid #dfe5ec;border-radius:10px;background:#f6f8fa;color:#17212f;font-size:14px;line-height:1.7;box-sizing:border-box\"><code>cp -a \/www\/server\/php\/83\/etc\/php-fpm.conf \\\r\n\/www\/server\/php\/83\/etc\/php-fpm.conf.before-socket-fix<\/code><\/pre>\n<p>\u518d\u628a\u5bf9\u5e94\u8bbe\u7f6e\u6539\u4e3a\uff1a<\/p>\n<pre style=\"width:100%;max-width:760px;overflow-x:auto;white-space:pre;margin:20px auto;padding:18px;border:1px solid #dfe5ec;border-radius:10px;background:#f6f8fa;color:#17212f;font-size:14px;line-height:1.7;box-sizing:border-box\"><code>listen = \/tmp\/php-cgi-83.sock\r\nlisten.owner = www\r\nlisten.group = www-data\r\nlisten.mode = 0660<\/code><\/pre>\n<p>\u8fd9\u91cc\u6ca1\u6709\u6539 PHP \u5de5\u4f5c\u8fdb\u7a0b\u7684\u8fd0\u884c\u7528\u6237\uff0c\u4e5f\u6ca1\u6709\u628a\u6743\u9650\u76f4\u63a5\u653e\u5230\u6240\u6709\u4eba\u90fd\u80fd\u8bbf\u95ee\uff0c\u800c\u662f\u8ba9\u5957\u63a5\u5b57\u6240\u5c5e\u7ec4\u4e0e\u5b9e\u9645\u8fde\u63a5\u5b83\u7684 Nginx \u5bf9\u5e94\u4e0a\u3002<\/p>\n<p>\u4fee\u6539\u540e\u68c0\u67e5\uff1a<\/p>\n<pre style=\"width:100%;max-width:760px;overflow-x:auto;white-space:pre;margin:20px auto;padding:18px;border:1px solid #dfe5ec;border-radius:10px;background:#f6f8fa;color:#17212f;font-size:14px;line-height:1.7;box-sizing:border-box\"><code>\/www\/server\/php\/83\/sbin\/php-fpm -t<\/code><\/pre>\n<p>\u7ec8\u7aef\u663e\u793a\u914d\u7f6e\u6d4b\u8bd5\u6210\u529f\u3002<\/p>\n<p>\u8fd9\u4e9b\u8def\u5f84\u3001\u7528\u6237\u548c\u7ec4\u662f\u6211\u8fd9\u53f0\u670d\u52a1\u5668\u4e0a\u7684\u5b9e\u9645\u60c5\u51b5\u3002\u522b\u4eba\u7684\u670d\u52a1\u5668\u4e0d\u4e00\u5b9a\u76f8\u540c\uff0c\u4e0d\u80fd\u53ea\u770b\u5230 Permission denied\uff0c\u5c31\u76f4\u63a5\u7167\u642c <code>www-data<\/code>\u3002<\/p>\n<h2 id=\"step-7\" style=\"color:#111111;font-weight:700;scroll-margin-top:130px\">\u4e03\u3001\u91cd\u65b0\u52a0\u8f7d\u540e\uff0c\u6743\u9650\u5c45\u7136\u6ca1\u53d8<\/h2>\n<p>\u914d\u7f6e\u6539\u597d\u540e\uff0c\u6211\u5148\u8fd0\u884c\uff1a<\/p>\n<pre style=\"width:100%;max-width:760px;overflow-x:auto;white-space:pre;margin:20px auto;padding:18px;border:1px solid #dfe5ec;border-radius:10px;background:#f6f8fa;color:#17212f;font-size:14px;line-height:1.7;box-sizing:border-box\"><code>\/etc\/init.d\/php-fpm-83 reload<\/code><\/pre>\n<p>\u7ec8\u7aef\u663e\u793a\uff1a<\/p>\n<pre style=\"width:100%;max-width:760px;overflow-x:auto;white-space:pre;margin:20px auto;padding:18px;border:1px solid #dfe5ec;border-radius:10px;background:#f6f8fa;color:#17212f;font-size:14px;line-height:1.7;box-sizing:border-box\"><code>Reload service php-fpm done<\/code><\/pre>\n<p>\u4f46\u518d\u67e5\u770b\u5957\u63a5\u5b57\uff0c\u4ecd\u7136\u662f\uff1a<\/p>\n<pre style=\"width:100%;max-width:760px;overflow-x:auto;white-space:pre;margin:20px auto;padding:18px;border:1px solid #dfe5ec;border-radius:10px;background:#f6f8fa;color:#17212f;font-size:14px;line-height:1.7;box-sizing:border-box\"><code>srw------- 1 www www ... \/tmp\/php-cgi-83.sock<\/code><\/pre>\n<p>\u53c8\u91cd\u65b0\u52a0\u8f7d\u4e86\u4e00\u6b21\uff0c\u7ed3\u679c\u8fd8\u662f\u4e00\u6837\u3002<\/p>\n<p><strong>\u7ec8\u7aef\u663e\u793a done\uff0c\u4e0d\u4ee3\u8868\u6211\u60f3\u4fee\u6539\u7684\u6743\u9650\u5df2\u7ecf\u751f\u6548\u3002<\/strong><\/p>\n<p>\u8fd9\u6b21 reload \u540e\uff0c\u770b\u5230\u7684\u5957\u63a5\u5b57\u65f6\u95f4\u3001\u6240\u5c5e\u7ec4\u548c\u6743\u9650\u90fd\u6ca1\u6709\u53d8\u5316\uff1b\u4ec5\u51ed\u8fd9\u4e9b\u73b0\u8c61\uff0c\u4e0d\u80fd\u786e\u5b9a reload \u5185\u90e8\u5177\u4f53\u53d1\u751f\u4e86\u4ec0\u4e48\u3002\u6211\u968f\u540e\u91cd\u542f\u7684\u662f\u5b9d\u5854 PHP 8.3 \u670d\u52a1\uff1a<\/p>\n<pre style=\"width:100%;max-width:760px;overflow-x:auto;white-space:pre;margin:20px auto;padding:18px;border:1px solid #dfe5ec;border-radius:10px;background:#f6f8fa;color:#17212f;font-size:14px;line-height:1.7;box-sizing:border-box\"><code>\/etc\/init.d\/php-fpm-83 restart<\/code><\/pre>\n<p>\u518d\u68c0\u67e5\u8fd0\u884c\u72b6\u6001\u548c\u5957\u63a5\u5b57\uff1a<\/p>\n<pre style=\"width:100%;max-width:760px;overflow-x:auto;white-space:pre;margin:20px auto;padding:18px;border:1px solid #dfe5ec;border-radius:10px;background:#f6f8fa;color:#17212f;font-size:14px;line-height:1.7;box-sizing:border-box\"><code>\/etc\/init.d\/php-fpm-83 status\r\nls -l \/tmp\/php-cgi-83.sock<\/code><\/pre>\n<p>\u8fd9\u6b21\u7ec8\u4e8e\u53d8\u6210\uff1a<\/p>\n<pre style=\"width:100%;max-width:760px;overflow-x:auto;white-space:pre;margin:20px auto;padding:18px;border:1px solid #dfe5ec;border-radius:10px;background:#f6f8fa;color:#17212f;font-size:14px;line-height:1.7;box-sizing:border-box\"><code>srw-rw---- 1 www www-data ... \/tmp\/php-cgi-83.sock<\/code><\/pre>\n<p>\u65b0\u914d\u7f6e\u5bf9\u5e94\u7684\u6743\u9650\u751f\u6548\u4e86\u3002<\/p>\n<p>\u64cd\u4f5c\u8fd9\u4e00\u6b65\u65f6\uff0c\u4e3b\u7f51\u7ad9\u4ecd\u7136\u4f7f\u7528 PHP 8.2\uff1b\u53e6\u4e00\u4e2a\u7f51\u7ad9\u8fde\u63a5\u7684\u662f\u53e6\u4e00\u5957\u7cfb\u7edf PHP-FPM\u3002\u6211\u5148\u786e\u8ba4\u4e86\u670d\u52a1\u8303\u56f4\uff0c\u518d\u91cd\u542f\u5b9d\u5854 PHP 8.3\u3002<\/p>\n<h2 id=\"step-8\" style=\"color:#111111;font-weight:700;scroll-margin-top:130px\">\u516b\u3001\u518d\u6b21\u5207\u6362\uff0cWordPress \u624d\u771f\u6b63\u7528\u4e0a PHP 8.3<\/h2>\n<p>\u6743\u9650\u4fee\u597d\u540e\uff0c\u6211\u628a\u4e3b\u7f51\u7ad9\u5b9e\u9645 Nginx \u914d\u7f6e\u91cc\u7684\u8fde\u63a5\u5730\u5740\uff0c\u518d\u6b21\u6539\u4e3a\uff1a<\/p>\n<pre style=\"width:100%;max-width:760px;overflow-x:auto;white-space:pre;margin:20px auto;padding:18px;border:1px solid #dfe5ec;border-radius:10px;background:#f6f8fa;color:#17212f;font-size:14px;line-height:1.7;box-sizing:border-box\"><code>fastcgi_pass unix:\/tmp\/php-cgi-83.sock;<\/code><\/pre>\n<p>\u68c0\u67e5\u5e76\u91cd\u65b0\u52a0\u8f7d\uff1a<\/p>\n<pre style=\"width:100%;max-width:760px;overflow-x:auto;white-space:pre;margin:20px auto;padding:18px;border:1px solid #dfe5ec;border-radius:10px;background:#f6f8fa;color:#17212f;font-size:14px;line-height:1.7;box-sizing:border-box\"><code>\/usr\/sbin\/nginx -t &amp;&amp; systemctl reload nginx<\/code><\/pre>\n<p>\u8fd9\u6b21\u56de\u5230 WordPress \u540e\u53f0\uff0c\u7ad9\u70b9\u5065\u5eb7\u663e\u793a\uff1a<\/p>\n<pre style=\"width:100%;max-width:760px;overflow-x:auto;white-space:pre;margin:20px auto;padding:18px;border:1px solid #dfe5ec;border-radius:10px;background:#f6f8fa;color:#17212f;font-size:14px;line-height:1.7;box-sizing:border-box\"><code>PHP \u7248\u672c\uff1a8.3.36\r\nPHP SAPI\uff1afpm-fcgi<\/code><\/pre>\n<p>\u9996\u9875\u3001\u6587\u7ae0\u9875\u548c\u540e\u53f0\u53ef\u4ee5\u6b63\u5e38\u6253\u5f00\uff0c<a href=\"https:\/\/liuqiangwujinjidian.com\/index.php\/2026\/10\/29\/wordpress-redis-installed-not-working\/\">\u6b64\u524d\u914d\u7f6e\u7684 Redis \u5bf9\u8c61\u7f13\u5b58<\/a>\u4e5f\u4fdd\u6301\u5df2\u8fde\u63a5\uff0c\u7ad9\u70b9\u5065\u5eb7\u68c0\u67e5\u901a\u8fc7\u3002<\/p>\n<p>\u5230\u8fd9\u91cc\uff0c\u624d\u7b97\u8fd9\u6b21\u5347\u7ea7\u5b8c\u6210\u3002<\/p>\n<h2 id=\"step-9\" style=\"color:#111111;font-weight:700;scroll-margin-top:130px\">\u4e5d\u3001\u8fd9\u6b21\u7ef4\u62a4\uff0c\u6211\u8bb0\u4f4f\u4e86\u51e0\u4ef6\u4e8b<\/h2>\n<p><strong>\u7b2c\u4e00\uff0c\u5148\u786e\u8ba4\u7f51\u7ad9\u5230\u5e95\u7531\u54ea\u5957\u670d\u52a1\u8fd0\u884c\u3002<\/strong><br \/>\u670d\u52a1\u5668\u88c5\u4e86\u5b9d\u5854\uff0c\u4e0d\u4ee3\u8868\u6b63\u5728\u4f7f\u7528\u7684\u5c31\u662f\u5b9d\u5854 Nginx\u3002\u53ea\u5728\u9762\u677f\u91cc\u6539\u7248\u672c\uff0c\u53ef\u80fd\u6ca1\u6709\u6539\u5230\u5b9e\u9645\u914d\u7f6e\u3002<\/p>\n<p><strong>\u7b2c\u4e8c\uff0c\u51fa\u73b0 502\uff0c\u5148\u770b\u65e5\u5fd7\u3002<\/strong><br \/>\u6211\u8fd9\u6b21\u65e5\u5fd7\u5df2\u7ecf\u5199\u660e <code>Permission denied<\/code>\u3002\u5982\u679c\u4e0d\u770b\u65e5\u5fd7\uff0c\u76f4\u63a5\u505c\u63d2\u4ef6\u3001\u6539\u4e3b\u9898\uff0c\u5f88\u53ef\u80fd\u5fd9\u534a\u5929\u4e5f\u78b0\u4e0d\u5230\u539f\u56e0\u3002<\/p>\n<p><strong>\u7b2c\u4e09\uff0c\u670d\u52a1\u542f\u52a8\u4e86\uff0c\u4e0d\u7b49\u4e8e Nginx \u80fd\u8fde\u63a5\u3002<\/strong><br \/>PHP-FPM \u6b63\u5e38\u8fd0\u884c\u3001\u5957\u63a5\u5b57\u6b63\u5728\u76d1\u542c\uff0c\u90fd\u4e0d\u4ee3\u8868\u8fde\u63a5\u6743\u9650\u4e00\u5b9a\u6b63\u786e\u3002<\/p>\n<p><strong>\u7b2c\u56db\uff0c\u4fee\u6539\u540e\u8981\u68c0\u67e5\u5b9e\u9645\u7ed3\u679c\u3002<\/strong><br \/>\u8fd9\u6b21 reload \u663e\u793a\u5b8c\u6210\uff0c\u4f46\u5957\u63a5\u5b57\u6743\u9650\u6ca1\u6709\u53d8\u5316\u3002\u6700\u540e\u662f\u91cd\u542f\u5bf9\u5e94 PHP \u670d\u52a1\u540e\uff0c\u624d\u786e\u8ba4\u751f\u6548\u3002<\/p>\n<p><strong>\u7b2c\u4e94\uff0c\u5347\u7ea7\u524d\u505a\u5907\u4efd\uff0c\u65e7\u7248\u672c\u5148\u4fdd\u7559\u3002<\/strong><br \/>\u6211\u63d0\u524d\u505a\u4e86\u7f51\u7ad9\u5907\u4efd\uff0c\u4e5f\u5907\u4efd\u4e86\u5b9e\u9645\u914d\u7f6e\u3002\u9047\u5230\u95ee\u9898\u5148\u56de\u9000\uff0c\u518d\u6162\u6162\u67e5\uff0c\u6bd4\u7f51\u7ad9\u4e00\u76f4\u6302\u7740\u66f4\u8e0f\u5b9e\u3002<\/p>\n<p>VPS \u6708\u8d39\u4fbf\u5b9c\uff0c\u662f\u6211\u9009\u62e9\u81ea\u5df1\u5efa\u7ad9\u7684\u539f\u56e0\u3002\u4f46\u8fd9\u6b21\u4e5f\u8ba9\u6211\u66f4\u6e05\u695a\uff1a<strong>\u670d\u52a1\u5668\u8d26\u5355\u53ea\u662f\u6210\u672c\u7684\u4e00\u90e8\u5206\uff0c\u7ef4\u62a4\u65f6\u95f4\u4e5f\u5f97\u7b97\u8fdb\u53bb\u3002<\/strong><\/p>\n<h2>\u76f8\u5173\u9605\u8bfb<\/h2>\n<p>\u8fd9\u6b21\u5347\u7ea7\u8fd0\u884c\u5728\u6211\u7684 InterServer VPS \u4e0a\uff0c\u5957\u9910\u8d39\u7528\u548c\u65e5\u5e38\u7ef4\u62a4\u611f\u53d7\u89c1<a href=\"https:\/\/liuqiangwujinjidian.com\/index.php\/2026\/10\/18\/interserver-vps-user-experience\/\">\u6bcf\u6708 6 \u7f8e\u5143\u7684 InterServer VPS \u5efa\u7ad9\u4f53\u9a8c<\/a>\uff1b\u540e\u7eed\u7684<a href=\"https:\/\/liuqiangwujinjidian.com\/index.php\/2026\/10\/29\/interserver-wordpress-china-telecom-access-test\/\">\u4e2d\u56fd\u7535\u4fe1\u8bbf\u95ee\u8bb0\u5f55<\/a>\u5219\u5355\u72ec\u8bf4\u660e\u6d4b\u8bd5\u6761\u4ef6\u4e0e\u8bf7\u6c42\u8017\u65f6\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>WordPress \u4ece PHP 8.2 \u5347\u7ea7\u5230 8.3 \u540e\u51fa\u73b0 502\uff0c\u6211\u5148\u56de\u9000\u6062\u590d\u7f51\u7ad9\uff0c\u518d\u4ece Nginx \u65e5\u5fd7\u7684 Permission denied \u627e\u5230\u5957\u63a5\u5b57\u6743\u9650\u95ee\u9898\u3002\u8bb0\u5f55\u4e24\u5957 Nginx \u7684\u914d\u7f6e\u5dee\u5f02\u3001PHP-FPM \u6743\u9650\u4fee\u590d\u548c\u9a8c\u8bc1\u8fc7\u7a0b\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[39],"tags":[],"class_list":["post-975","post","type-post","status-publish","format-standard","hentry","category-vps"],"_links":{"self":[{"href":"https:\/\/liuqiangwujinjidian.com\/index.php\/wp-json\/wp\/v2\/posts\/975","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/liuqiangwujinjidian.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/liuqiangwujinjidian.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/liuqiangwujinjidian.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/liuqiangwujinjidian.com\/index.php\/wp-json\/wp\/v2\/comments?post=975"}],"version-history":[{"count":4,"href":"https:\/\/liuqiangwujinjidian.com\/index.php\/wp-json\/wp\/v2\/posts\/975\/revisions"}],"predecessor-version":[{"id":1006,"href":"https:\/\/liuqiangwujinjidian.com\/index.php\/wp-json\/wp\/v2\/posts\/975\/revisions\/1006"}],"wp:attachment":[{"href":"https:\/\/liuqiangwujinjidian.com\/index.php\/wp-json\/wp\/v2\/media?parent=975"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/liuqiangwujinjidian.com\/index.php\/wp-json\/wp\/v2\/categories?post=975"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/liuqiangwujinjidian.com\/index.php\/wp-json\/wp\/v2\/tags?post=975"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}